2012-08-01 144 views
1

在Visual Studio 2010中,我嘗試使用add connection嚮導與SQL Server數據庫建立連接,但連接失敗!從Visual Studio到SQL Server 2005的連接

這是我的錯誤:

a network-related or instance-specific error occured 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:Named Pipes Provider, error:40 -Could not open a connection to SQL Server)

額外的信息;

  • 我可以ping服務器!
  • SQL Server允許遠程連接!
  • SQL服務正在運行!

這是什麼問題?

+0

您是否在服務器上使用多個sql server實例?如果是這樣,你需要正確設置服務器名稱 – stb 2012-08-01 12:32:23

+0

只需要1個SQL數據庫! – user1565210 2012-08-01 12:34:06

+0

你有什麼試過?你是否退出Visual Studio並重新啓動以再次嘗試連接?你確定你使用正確的服務器名稱嗎? – Nathan 2012-08-01 12:36:10

回答

0

要解決此問題,請根據症狀下列方法之一,您遇到:

  • SQL Server登錄

使用有效的Windows登錄連接到SQL Server。如果您必須繼續使用SQL Server登錄,則可以將SQL Server中的安全身份驗證模式更改爲SQL Server和Windows。

  • Windows帳戶權限不足

要解決此問題,必須將Windows帳戶添加到SQL Server,然後授予每個數據庫中的相應權限,用戶需要訪問至。

來源:http://support.microsoft.com/kb/889615/en-us