A network-related or instance-specific error occurred while establishing a connection to SQL Server
-
2009年3月15日 22:02I got this error when i try to connect to sql server10.0 from c# 2008 express. any idea.
Pedro
全部回复
-
2009年3月16日 20:07版主Hello,
Please, could you provide your code related to your connection ?
A good idea is to surround your code with a try/catch
For an example, see this link :
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlexception.number.aspx
I add always the properties Source,TargetSite , StackTrace,ErrorCode and Number
the string so obtained is really helpful to detect the source of the problem
With the following link, you may find a solution to your problem
http://blogs.msdn.com/sql_protocols/archive/2005/09/28/474698.aspx
in fact, you should find at least 6 articles about this problem ( or a similar one )
Dont'hesitate to post again for more help or explanation
Have a nice day -
2009年3月17日 15:54Thanks for your fast resonse. I didn't have any code, i am using the Data - Add new Data Source - Database - New Connection - Microsoft SQL Server Database File (SqlClient) and choose Adventure Dataworks.mdf - Test Connection and gives me the error.
Pedro -
2009年3月17日 17:44版主Hello,
Have you looked on the link towards the blog SQLProtocols i gave you ?
Every possible connection problem is explained with at least one solution each time
Have a nice day -
2009年3月18日 18:48版主Hi Pedro,
Here is a good Protocols blog entry which provides a step-by-step guide for generic connectivity troubleshooting: http://blogs.msdn.com/sql_protocols/archive/2008/04/30/steps-to-troubleshoot-connectivity-issues.aspx
We should be able to give more targeted information if you can get a more complete error message. I'm not familiar with the Add New Data Source interface, so I don't know if it's possible, but if there is any error number or a longer error message, please post it here.
This post is provided 'as is' and confers no express or implied warranties or rights. -
2010年5月29日 11:32
I had a similar problem with sql server 2008 , where I am not able to connect to remote database enginer and getting the same error. However, was able to resolve the issue after deleting named pipe Alias from ‘SQL Native Client 10.0 Configuration (32bit).
Regards
Sreekanth
Thanks Sreekanth -
2010年9月9日 6:56
-
2010年9月21日 7:04
A network-related or instance-specific error occurred while establishing a connection to SQL Server
-
2012年7月24日 7:01
refer this links
1.http://www.codeproject.com/Questions/244140/A-network-related-or-instance-specific-error-occur
2.Solution for Network related error in sql server
- 已编辑 DevSolvijay 2012年7月26日 2:58
-
2012年12月3日 9:18
Below are the list of things to be check
- SQL Server is running or not
- Check TCP/IP Port is open or not
- check for firewall settings port is open or not
- SQL Server security settings have windows/sql authentication
- check for sql server configuration settings allow remote connections
Ramesh Babu Vavilla MCTS,MSBI

