我正在使用Visual Studio並嘗試連接到Northwind數據庫。我用下面的連接命令連接到SQL數據庫
Data Source=C:\\Program Files (x86)\\Microsoft SQL Server Compact Edition\\v3.5\\Samples\\Northwind.sdf;Initial Catalog=Northwind;Integrated Security=SSPI"
我也曾嘗試
Data Source=(local);Initial Catalog=Northwind;Integrated Security=SSPI
這兩種情況下我得到一個錯誤 -
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)
我可以連接到一個在線數據庫,但不在遙遠的一個。我已經檢查過配置管理器,所有的服務都在運行。
任何幫助,請
什麼數據庫你試圖連接到,你的第一個連接字符串是SQL Server CE(精簡版)。您是否嘗試過Connectionstrings.com http://www.connectionstrings.com/ – Lloyd 2012-01-27 10:00:33
您是否檢查過數據庫實際上正在運行,並且它允許您發送的用戶/憑證的連接? – Purplegoldfish 2012-01-27 10:21:53