我在本地连接Northwind.mdf但是当我上传应用程序远程服务器上,然后我得到以下错误:IIS:连接到数据库.MDF - 网络配置问题
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)
这些都是我试过几个选项:
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Northwind.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
上面的一个在当地工作。
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=D:\ASP\TestSite\App_Data\Northwind.mdf; Integrated Security=True;Connect Timeout=30;User Instance=True;Trusted_Connection=Yes"/>
</connectionStrings>
在服务器上安装SQL Server 2005
感谢,
伊利亚·
你的连接〜应变g表示** Express **版本,但您只提到“SQL Server 2005” - 它是什么?它是SQL Server 2005 ** Express **在您的远程主机上,还是完整版本的SQL Server 2005? – 2010-12-21 15:54:49