Click here to Skip to main content
15,917,618 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have created an application in .NET that connects to an SQL Server Instance that runs in a remote machine. The problem I am getting is, some users can connect and normally use that application but for some users, this error message is coming...

"An error has occurred while establishing a connection to the server. When connecting to SQL Server, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)"

I googled and tried the following :-
1) Enabled the Named Pipes and TCP/IP in Sql Server Configuration Manager.
2) Added the exceptions to my Firewall : a) sqlsrvr.exe b)sqlbrowser

Still I am getting the same error. I am not understanding what I need to do to resolve that as some users are able to connect but some users are not...
Please help...............

THANKS in ADVANCE...
Regards
Jashobanta
Posted
Comments
Zoltán Zörgő 4-Jul-12 11:21am    
Can you connect with Management Studio using tcpip on the server? Have you restarted the server? Have you checked if server is listening to that ports? Can you connect with Management Studio using tcpip on the client? Have you traced the connection status with sysinternals tcpview?

Generally, it is surface area configuration error or sql service configuration issue. Have a look at this thread for potential reasons and resolutions: Resolving A network-related or instance-specific error occurred while establishing a connection to SQL Server[^]

If needed, See steps for setting up Surface area configuration here..

Here, look at the following blog entries related to the same:
Under the default settings SQL Server does not allow remote connections[^]
It says:
I. Make sure that Remote Connections are enabled in Surface Area Configuration tool
II. Check Whether TCP/IP protocol is enabled in the SQL Server Configuration Manager
III. Make sure that SQL server Browser service is running
 
Share this answer
 
Comments
Jashobanta 3-Aug-12 9:19am    
Hi Sandeep,
Thanks for the info. I have tried using the same. The problem is, some systems are able to connect or to say, some users are, remaining are not allowed to. I am goin mad finding how to resolve that.

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