0

我在我的测试Web服务器上创建了一个测试SQL Server 2005数据库。我有一个ASP.Net MVC 4网络应用程序也在该测试服务器上连接到测试sql服务器数据库,它没有任何问题。连接字符串在Web服务器上工作但不在本地

现在,我尝试使用本地PC上的MVC应用程序副本来连接到测试Web服务器上的测试数据库。我想我可以使用与Web服务器上使用的MVC应用程序相同的连接字符串,但是,当我复制该连接字符串并将其放入本地MVC应用程序的Web配置中时,尝试连接,并获得以下内容错误

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)

为什么连接字符串对测试服务器上的MVC应用程序有效,但对于我本地的MVC应用程序副本不起作用?

感谢您的帮助。

回答

2

Why would the connection string work for the MVC application on the test server, but not for my local copy of the MVC application?

因为有一个防火墙阻止您的计算机访问此SQL服务器。或者,也许SQL服务器与您的计算机位于完全不同的网络上,并且无法直接访问。

与您的网络/ SQL Server管理员联系以寻求帮助。

+0

谢谢,看起来它是一个防火墙问题。 – tgriffiths

相关问题