我正在用C#應用程序部署我的數據庫,但當我在另一臺機器上安裝setup.exe
文件時,我無法連接到數據庫。C#和SQL Server部署問題
我得到的錯誤是:
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 connection.(provider:Named pipes Provider,error:40- could not open a connection to SQL Server)
我應該怎麼做才能解決這個?
你的連接字符串是什麼?這聽起來像你不能正確地擊中'servername [\ instancename]'。 – 2011-12-23 14:38:15
什麼代碼用於連接? SQL遠程? – bryanmac 2011-12-23 14:39:06
上次我有一個「命名管道提供商錯誤」,這是一個防火牆問題(允許TCP連接的SQL Server的規則丟失)。 當SQL Server無法使用默認的TCP提供程序時,它會嘗試使用命名管道。 – ken2k 2011-12-23 14:43:37