0
我有一個本地數據庫「模式」,我需要通過我的2個應用程序連接到它。一個應用程序僅基於我的數據庫'Model'中定義的表的子集。我的連接字符串是無法連接到SQL數據庫,獲得網絡Error26
<add name="Model"
connectionString="Data Source=localhost;Initial Catalog=Model;Integrated Security=True;Trusted_Connection=true;"
providerName="System.Data.SqlClient" />
我對這兩個應用程序使用相同的連接字符串。應用程序1(少表)連接和加載數據就好了。問題是應用2扔我的錯誤:
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)
所有淨解決方案是基於檢查,如果我有正確的連接字符串,如果我啓用了遠程會話,這一切工作,因爲我的應用1作品。 有什麼可以與應用2錯了?我應該從哪裏開始尋找問題?
我試着用\的SQLExpress,它仍然拋出了同樣的錯誤。應用程序1使用完全相同的連接字符串並正常工作。我還能嘗試什麼? – Tulips
你使用的是實體框架嗎? – SimonGates
是的,我使用實體框架。我有另一個數據庫連接字符串,我認爲這很好連接。 – Tulips