試圖找出SQL Server Express數據庫的正確連接字符串。嘗試將我的應用程序發佈到IIS並在發佈到我的託管站點之前進行測試。SQL Server Express連接字符串錯誤
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)
我開始here也使用connectionstrings.com
。我也開始閱讀使用SQL Server精簡文章here
使用此連接字符串
Data Source=.\\SQLExpress;AttachDbFilename=H:\DB\Guestbook.sdf;Integrated Security=True
我得到上述錯誤部署asp.net應用
此連接字符串
<add name="DefaultConnection"
connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI; database=Guestbook; AttachDBFilename=|DataDirectory|Guestbook.sdf"
providerName="System.Data.SqlClient" />`
拋出信任級別錯誤。我已經更改爲中等和完整,仍然得到兩個錯誤之一。
我試過了幾個不同的字符串的變體,沒有運氣。
感謝