錯誤消息是這樣的:「服務器未找到或無法訪問」爲SQL Server錯誤2008
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: 51 - An instance name was not specified while connecting to a Local Database Runtime. Specify an instance name in the format (localdb)\instance_name.)
而且我的情況:IIS和SQL Server 2008是相同的測試工作站,其防火牆上根本沒有啓用。我沒有看到任何SQL Server日誌,因此我找不到比上面的錯誤消息更多的其他有用信息。
我安裝了SQL Server的默認實例(MSSQLSERVER
)
我的連接字符串是這個樣子(我使用SQL Server帳戶進行身份驗證):
Server=(localdb); Database=MY_DB_NAME; User ID=MY_USER_ID; Password=MY_PASSWORD
我已經驗證了該用戶訪問目標數據庫(作爲所有者)
我已經通過一些關於如何追蹤此問題的文章:即使IIS和SQL Server位於同一臺計算機上,我也設置了「允許遠程連接」。我不需要設置防火牆。
我發誓上帝,我嘗試了兩個。或(當地)在某些不起作用的地方。但我想那是因爲現在當我嘗試(本地)或我的本地IP地址時,他們都在工作,因爲其他事情是錯誤的。謝謝! – tete