2014-04-09 28 views
0

当连接到SQL Server 2012快速从Asp.Net的应用程序,我得到下面的异常指定的服务器/实例:SQL网络接口,错误:26 - 错误定位,同时通过asp.net应用程序连接

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)

虽然,我可以远程连接到SQL Server,但是一旦我将应用程序发布到数据库所在的服务器上,我就得到了上述异常。

我试过在网上共享的各种方法,但没有为我工作。有什么建议么?

回答

0

连接字符串应该存在问题。检查Sql Server中的实例名称,然后将该实例名称粘贴到连接字符串中。

0

这个错误是最糟糕的,因为你通常不知道究竟是什么问题。下面是一些可能的解决方案:

  • 检查服务器名称是否正确
  • 检查实例名称是否正确
  • 检查您的服务器可以访问(似乎不是你的问题)
  • 检查该SQL Browser服务正在运行
  • 检查防火墙规则

有时SQL错误26只是隐藏了另一个问题机智h连接(f.e. SQL错误0)。

相关问题