0

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?

4
  • What is your connection string? It sounds like you can't hit the servername[\instancename] properly. Commented Dec 23, 2011 at 14:38
  • 2
    What code is used to connect? Is SQL remote? Commented Dec 23, 2011 at 14:39
  • 1
    Last time I had a "named pipes provider error", it was a firewall issue (the rule that allows TCP connections for SQL Server was missing). When SQL Server doesn't manage to use the default TCP provider, it tries to use named pipes. Commented Dec 23, 2011 at 14:43
  • Do you know if Port 1433 (or whatever port you are using for SQL Server) is being blocked? serverfault.com/questions/26564/… Commented Dec 23, 2011 at 16:58

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.