Introduction:
Here I will explain how to solve the problem “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)” during the time of connect to database.
Description:
Now restart your SQL Server Management Studio and check it I hope it will work for you.
Here I will explain how to solve the problem “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)” during the time of connect to database.
Description:
Today I opened SQL Server Management Studio in my laptop to connect to database unexpectedly I got error like “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 didn’t get why this happened because previously it worked perfectly. To solve this problem I did some research and found solution at that time I decided to write post to help someone who is in need with this problem. Check below methods to solve this problem.
First Method
Open SQL Server Management Studio now Connect window will open check whether you given proper Server Type and Server Name or not because if we give incorrect details then we have a chance to get this issue.
Second Method
1. Go to Start >> Select All Programs >> Microsoft SQL Server 2008 R2 >> Configuration Tools >> SQL Server Configuration Manager
(Note: I installed SQL Server is 2008 R2 version in my laptop that’s why I selected Configuration Tools from Microsoft SQL Server 2008 R2 in case yours is Microsoft SQL Server 2008 then select Configuration Tools from that SQL Server version)
2. After open SQL Server Configuration Manager >> Select SQL Server Services >> Select SQL Server (MSSQLSERVER) and check the status of SQL Server (MSSQLSERVER) whether is it running or not
3. If SQL Server (MSSQLSERVER) Status is in Running it’s ok otherwise right click on SQL Server (MSSQLSERVER) and click Start
4. Now select SQL Server Network Configuration >> Select Protocols for MSSQLSERVER >> TCP/IP and check status of TCP/IP whether is it enabled or not if that TCP/IP state is in Disabled state right click on it and Enable that one.
Now restart your SQL Server Management Studio and check it I hope it will work for you.
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
12 comments :
Helloo sir,I am getting this error online..I have added profile section in web.config..please suggest a solution!!
I have the same configuration but the conection doesn't work. What else should I test?
Hello Sir,
I have enabled the TCP/IP but still i am getting the same error please suggest me what i have to do.
hello sir,
i have same error in sql server 2005, can i take same solution you given.pls send me rep..
hello sir,
when i open (sql server services) then no any option will display.what can i do.
thanx alot useful info
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)
SQL server 2005
Thank You....
when connect to the server it will give me following error
'ChurchDataBase'
can you give the solution on that
itz gud thanx 4 d info...i didnt knw nythng...i always take this thngs lite wen ma seniors were teaching it
onkeshwar..
Microexcel
I have tried all the steps you suggestd above. But still i am not able to stat that TCP/Ip protocol. and aslo not able to start MSSQLSERVER instance. Please suggest.
Thank You Very Much Sir :)
Note: Only a member of this blog may post a comment.