Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends
I create a sql server databse with sqlserver management studio and
use it in c# project by remote connection but by running
application following error appear
A network-related or instance-specific error occured while establishing
a connection to sql server


what's solution?
Posted
Updated 31-Dec-11 1:17am
v2
Comments
Espen Harlinn 31-Dec-11 7:30am    
You have to provide some information about your code/design - based on what you have provided we can only guess wildly ... for all I know you could be serializing the SqlConnection object from the server to the client ...

Basically it means that the SQL Server is not responding. There are lots of possible reasons like, its not on, firewall blocking etc.

Have a look at for example this: http://www.sqlmusings.com/2009/03/11/resolving-a-network-related-or-instance-specific-error-occurred-while-establishing-a-connection-to-sql-server/[^]
 
Share this answer
 
Comments
Espen Harlinn 31-Dec-11 8:46am    
5'ed!
Wendelius 2-Jan-12 3:30am    
Thanks :)
thatraja 31-Dec-11 14:10pm    
5!
Wendelius 2-Jan-12 3:30am    
Thanks :)
 
Share this answer
 
Comments
Espen Harlinn 31-Dec-11 8:46am    
5'ed!
RaviRanjanKr 31-Dec-11 9:00am    
Thanks :)
thatraja 31-Dec-11 14:12pm    
5!
RaviRanjanKr 31-Dec-11 16:23pm    
Thanks :)
Wendelius 2-Jan-12 3:31am    
Good links, 5'd
Basically, when you failed to connect to your SQL Server, the issue could be:
1) Network issue,
2) SQL Server configuration issue.
3) Firewall issue,
4) Client driver issue,
5) Application configuration issue.
6) Authentication and logon issue.
Check these
Steps to troubleshoot SQL connectivity issues[^]
SQL Server 2005 Connectivity Issue Troubleshoot - Part I[^]
Troubleshoot Connectivity Issue in SQL Server 2005 - Part II[^]
Troubleshoot Connectivity Issue in SQL Server 2005 - Part III[^]

BTW check this bunch also for future errors
 
Share this answer
 
Comments
Espen Harlinn 31-Dec-11 8:46am    
Checking these things out is a good start, my 5
Wendelius 2-Jan-12 3:31am    
Good collection, 5
Recheck Your connection string and for more help follow the link
Connection String ^
 
Share this answer
 
Comments
thatraja 31-Dec-11 14:12pm    
No, only 4 for your answer, wrong connectionstring may be a case but what about other cases? check my 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