Reputation: 14148
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)
Upvotes: 1
Views: 599
Reputation: 14148
I solved it by fully qualifying domain name for server setting in my connection string.
<add name="MyName" connectionString="server=MyServer.FullDomainName; uid=MyUid; pwd=MyPwd; database=MyDB" providerName="System.Data.SqlClient"/>
Upvotes: 1