Configure SQL Server to Allow Remote Connections
- by Ben Griswold
Okay. This post isn’t about configuring SQL to allow remote connections, but wait, I still may be able to help you out.
"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: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)"
I love this exception. It summarized the issue and leads you down a path to solving the problem. I do wish the bit about allowing remote connections was left out of the message though. I can’t think of a time when having remote connections disabled caused me grief. Heck, I can’t ever remember how to enable remote connections unless I Google for the answer.
Anyway, 9 out of 10 times, SQL Server simply isn’t running. That’s why the exception occurs. The next time this exception pops up, open up the services console and make sure SQL Server is started. And if that’s not the problem, only then start digging into the other possible reasons for the failure.