我在本地連接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