I am deploying my database with a C# application but I am unable to connect to the database when I am installing the setup.exe file on different machine.
The error I get is:
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)
What should I do to overcome this?
It can be number of reasons. Most probable…either your connection string is not correct(which is most probable), or the instance you are trying to connect doesn’t have Named Pipes enabled.
To check the later one go to Programs -> SQL Server {version} -> Configuration Tools -> SqlServer Configuration Manager -> find Client protocols and then find Named Pipes/TCP/IP and set it to Enabled