Click here to Skip to main content
14,937,212 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends
i want my C# windows application to connect a sql server which is hosted in online site

My Connection String:

C#
cs = new SqlConnection("Server=hostingsite.in,2083; Initial Catalog=DBName; User ID=XXXXX; Password=YYYYY;");


when executing this query the following error is shown


A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)
Posted
Comments
Sampath Kumar Sathiya 26-Dec-12 2:20am
   
Instead of domain name in server, use that server ip.

May be this link is helpfull for you...


How to get Connection String from App.Config in c#[^]
   
"data source=Servernm/ipAddress; Initial Catalog=DBName; User ID=XXXXX; Password=YYYYY;"

Happy Coding!
:)
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900