Explore Courses Blog Tutorials Interview Questions
+2 votes
in Azure by (20.3k points)

I get the following error when trying to connect to SQL Server:

Cannot connect to

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) (Microsoft SQL Server, Error: 1326)

This error is thrown when I try to configure my database to gridview in Visual Studio 2010. I'm at a loss as to how to debug this error.

How would you debug this error? What steps should I take in order to determine what is really going on here, in addition to the one mentioned in the error message?

1 Answer

+2 votes
by (16.8k points)

Hi, basically, this error comes whenever your SQL Service is stopped or interrupted, I'd suggest you restart the SQL Service then go the window where you have to search the services as shown below:

enter image description here

After that search - SQLSERVER(MSSQLSERVER) then "Restart" the service as shown here:


I hope this would be helpful!

Browse Categories