A network-related or instance-specific error occurred while e
(2013-03-07 13:20:08)
标签:
anetwork-relatedorin.confi配置 |
分类: 每日小白 |
犯了一个因为懒惰造成的低级错误,VS执行SQL语句代码时报错如下:
"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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
开始一直认为是.confi配置文件或数据库设置的问题,最后发现是数据库连接字符串ConnectionString不正确,花费了一个多小时的时间。
启示:有问题立马就去百度是不对的,自己要查找出现问题的根源所在,看是否有决绝办法。
不要因为懒惰而直接复制报错信息到百度或Google,结果找出一大堆解决办法,都验证了一遍没一个有用的。。。
这种傻了吧唧的错误我好像犯了不止一次了,慎记。
"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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
开始一直认为是.confi配置文件或数据库设置的问题,最后发现是数据库连接字符串ConnectionString不正确,花费了一个多小时的时间。
启示:有问题立马就去百度是不对的,自己要查找出现问题的根源所在,看是否有决绝办法。