我不斷收到此錯誤的LocalDB當我嘗試在包管理器控制檯做一個更新的數據庫命令:無法連接在Visual Studio
ClientConnectionId:00000000-0000-0000-0000-000000000000 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: 50 - Local Database Runtime error occurred. Specified LocalDB instance name is invalid. )
我的連接字符串是:
<connectionStrings>
<add name="BookServiceContext" connectionString="Data Source=(localdb)\\v11.0; Initial Catalog=BookServiceContext-20150228232739; Integrated Security=True; MultipleActiveResultSets=True; AttachDbFilename=|DataDirectory|BookServiceContext-20150228232739.mdf" providerName="System.Data.SqlClient" />
</connectionStrings>
我可以通過SSMS 2014連接,我可以在SQL Server對象資源管理器中看到(localdb)\MSSQLLocalDB
和(localdb)\ProjectsV12
。
編輯
即使在連接字符串的一部分被改爲: AttachDbFilename = | DataDirectory目錄| \ BookServiceContext-20150228232739.mdf」
它仍然拉動了同樣的錯誤
隨着上述變化,但還是去拉一樣錯誤。連接字符串在Visual Studio中自動生成。 – 2015-03-03 06:30:53
查看我的更新回答。也許它仍然會有所幫助: - ] – t3chb0t 2015-08-10 16:07:07