Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
my connection string giv en below

C#
<add name="ConnectionString" connectionString="Server=182.50.151.49;Database=AnbU12_pro;User ID=***;Password=***;Trusted_Connection=False;" providerName="System.Data.SqlClient"/>


Error Msg :

<pre lang="C#">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)</pre>
Posted
Updated 18-Dec-15 1:49am
v2
Comments
AnvilRanger 18-Dec-15 7:50am    
I updated your question to remove the user is and password. You should never publish information like that in a public forum.

First of all . Check your server (182.50.151.49) working or not .
if the server is working fine than check sql Server Service. (is running or not).

Second think is :
Make sure your database engine is configured to accept remote connections:

For more details about your problem . please follow below link .

http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/[^]

http://stackoverflow.com/questions/18060667/why-am-i-getting-cannot-connect-to-server-a-network-related-or-instance-speci[^]

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.[^]

Regards,
AARIF SHAIKH
 
Share this answer
 
I too agree with aarif post, if the server is not working you can't able to open the database and execute the scripts over there. I suggest you to check with your system team to resolve network related issue first and then recheck again.
 
Share this answer
 

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