Click here to Skip to main content
16,012,061 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have developed an on line test application and successfully hosted it on line. I have also purchased mssql database on that provider. But when i am trying to run my project from my machine it is giving me this error.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

the database connection string i have used is given below:
this.sConnectionString = "Data Source=112.56.175.194;Initial Catalog=MockTestDatabase;integrated security=true;User ID=xyz;Password=abc";
Posted
Comments
sahabiswarup 4-Mar-12 23:52pm    
i have also found this type of error; and after a long research i have found that these above error shows when SQL server is not opening with the given connection properties. so please check your SQL connection properties

 
Share this answer
 
 
Share this answer
 
Hi,
you may don't have direct access from your machine to hosted MS SQL server provider. You can check connectivity by executing below command.
telent IP_addressof_MS_SQL_Server Port_Number
e.g. Telnet 123.10.22.11 1433.

Defaut port for MS SQL server is 1433
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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