,當我嘗試從C#代碼連接到SQL服務器,我提示以下錯誤:只在我的機器上的網絡相關或實例特定錯誤
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)
我的連接字符串看起來像這樣
"Data Source={DatabaseServer};Initial Catalog={DatabaseName};Integrated Security=SSPI;Enlist=false;"
我嘗試了很多文章中找到的所有選項,但無法解決問題。還有一點需要注意的是,我的同事能夠從他的機器上運行相同的代碼。所以它顯然不是SQL Server的問題。它必須對我的機器做些什麼。任何人都可以給我任何指示,可能是什麼問題?我能夠通過SSMS連接到SQL服務器實例。
聽起來像您的機器無法看到網絡上的服務器。這可能是一個完整的可能性清單。 –
您是否嘗試過使用ping/traceroute檢查您的電腦是否可以訪問機器? – gmiley
@gmiley是的,ping和我可以看到回覆 – Viru