Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Dear All,

am working on asp.net Project using C# and SqlServer 2005 database.

My database is in remote Server and my asp.net project is in my local pc. WHEN i run the project it shows connection error.

This is the 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)


Please can you give a solution.

Thanks in ADVANCE.
Posted

Please check the following article and review the steps to fix this issue. I can not say it is due to a specific problem. It can your DNS, firewall, TCP/IP.. etc.

SQL SERVER – FIX : ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: )[^]

Good luck,
OI
 
Share this answer
 
Comments
thatraja 11-Nov-13 1:51am    
5! Glad to see you again angryface
Orcun Iyigun 11-Nov-13 2:15am    
Haha. Thank you :)
Hi,

Me too faced this issue, and probably most of the programmer who tend to connect to remote server without configuring the remote server settings.I was struggling for almost 2hrs for this error... ;-)

So here is how to get rid of this sarcastic error,

1) In remote server --> SQL server configuration manager(can be find out in start menu)
2) SQL Native client 10.0 configuration --> Client Protocols --> Enable all Protocol name.
3) Now restart the sqlserver service in service.msc.
4) Now try to connect remote server from your machine

Have fun....

Regards,
RK
 
Share this answer
 
v2

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