Normally the reason behind getting the error – “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: 53)” in MS SQL server 2008 is for not to enabling the TCP/IP protocol of MSSQLServer or SQLExpress.
But today when I tried to run the software which database stored in another PC, couldn’t connect with the database at all. Then I checked the TCP/IP status is enabled or not from SQL Server configuration manager and I found that TCP/IP is already enabled for both the MSSQLServer and SQLExpress.
Then after two hours doing so many things, I got the solution.
When I installed MS SQL server in server machine in that time there was no IP assigned in that server. But few days ago I assigned an IP on that server to include this machine into domain. Then I thought that may be this could be a problem and I did what I thought and It works. Now I will tell you how I solved it.
Step 1: Open SQL Server configuration manager from start > All Programs > Microsoft SQL Server 2008 > Configuration Tools.
Step 2: From SQL Server configuration manager window select Protocols for SQLExpress/Protocols for MSSQLSERVER (Which one you need) from left side tree menu. Then you will see all the protocols available in right side.
Step 3: From the available protocol right click on TCP/IP and click on properties. Then TCP/IP properties window will appear. Click on IP Addresses tab. Then set the IP address (IP Address that is assigned in SQL Server installed machine) into IP Address text box.
And the problem is solved. Provide a image of this window for your help.