2011-04-25 102 views
0

我有一个服务,会谈到本地 SQL Server实例。我收到错误SQL Server超时

System.Data.SqlClient.SqlException:
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)

此错误间歇性发生。由于这是我持续集成过程的一部分,因此我必须再次执行整个构建过程,这是很痛苦的。

我想说清楚,我不是每次都遇到这个问题的随机性质。

请帮我这个。

+1

“请帮我这个 。” - 没有太多去。你有一个间歇性的问题;我们没有足够的信息。 – 2011-04-25 08:32:30

+0

您是否使用ASP.net网站,赢取表单应用程序和PHP网站连接到数据库。你在用什么:)?你打电话询问什么样的问题? – Ivo 2011-04-25 08:34:27

+0

我正尝试通过Windows服务进行连接。 – Sandeep 2011-04-25 08:43:53

回答

0

您是否试过通过SQL Server Confoguration工具切换各种连接接口?我怀疑你可能通过TCP/IP连接,这可能是其他地方网络问题的主题。由于您位于服务器本地,因此可以禁用该接口并强制使用共享内存,这应该可以帮助您解决问题。

有关连接类型的详细信息,请参阅http://msdn.microsoft.com/en-us/library/ms187892.aspx