简体   繁体   中英

on my VM: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified

From my dev machine, I can successfully connect to the sql server. Other programmers can successfully connect as well from their dev machines.

I setup a VM, installed VS2010 , connected to TFS, and did get latest on my code. I was able to successfully build the .sln on VM. But on VM, when I run the application, I get the following error with yellow screen. How do I fix this on VM. It works on my local dev but not on VM. Please help.

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)

我通过在连接字符串中完全限定服务器设置的域名来解决此问题。

<add name="MyName" connectionString="server=MyServer.FullDomainName; uid=MyUid; pwd=MyPwd; database=MyDB" providerName="System.Data.SqlClient"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM