5

We got a MS SQL server and two web site servers. I'm in the process of moving all the sites from one of the web site servers to the new one.

My asp.net sites are not able to connect to the external ms sql server after I've moved them to the new server. I'm able to both ping the MS SQL server and access it by telnet using the port 1433 from the web site server.

It works perfect from the old web site server so my guess is that there's something to do with the new server. I've tried to disable the firewall without it helping either.

Help would be much appreciated!

I get the following errors on two different sites (one running .net 2 and other .net 4):

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)

Exception Details: System.Data.SqlClient.SqlException: 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)

[SqlException (0x80131904): 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)]
DataAccessManager.ExecuteNonQuery(DbCommand command) in C:\Websites*\App_Code\DataAccessManager.vb:31
InsiteError.Save() in C:\Websites*\App_Code\System\InsiteError.vb:89

And

The network path was not found

Exception Details: System.ComponentModel.Win32Exception: The network path was not found

[Win32Exception (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond]

[SqlException (0x80131904): 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: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)]
DataAccessManager.ExecuteSelectCommand(DbCommand command) in C:\Websites*\App_Code\DataAccessManager.vb:18
InsitePage..ctor(String file_name, PageResult& Result) in C:\Websites*\App_Code\InsitePage\InsitePage.vb:68
_Default.Page_PreInit(Object sender, EventArgs e) in C:\Websites*\default.aspx.vb:298
BasePage.OnPreInit(EventArgs e) in C:\Websites*\App_Code\System\BasePages\BasePage.vb:249 System.Web.UI.Page.PerformPreInit() +49
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1844

-- Update -- Trying to connect with ms sql management studio from the new server do I get the following error:

TITLE: Connect to Server

Cannot connect to *.

------------------------------ ADDITIONAL INFORMATION:

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)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=53&LinkId=20476


The network path was not found

  • When you say, "I'm able to both ping the MS SQL server and access it by telnet using the port 1433 from the web site server," I assume you mean the new server? Are you referring to it in the exact same way as you do in your code? – Katherine Villyard Mar 28 '14 at 17:10
  • Can you install Mgmt Studio on the new server and use that to connect to the DB? I find it easier to debug connection issues there, rather than inside the app under IIS. – jimtut Mar 28 '14 at 17:25
  • @KatherineVillyard Yup, on the new server and yeah same ip and port :) – Arne H. Bitubekk Mar 28 '14 at 19:44
  • @jimtut Good idea, I'll test that now :) – Arne H. Bitubekk Mar 28 '14 at 19:45
  • Are both SQL instances "default" instances, or named instances? – Katherine Villyard Mar 28 '14 at 21:31
0

Our hosting company had restricted the connection to SQL server to only be from IP addresses from the local network. The old website server was within this local network but the new website was in a different network. Our hosting company ended up fixing the issue after going several rounds them.

What threw me off was that when I remotely logged in on the new web server, then I could both ping and access the server by telnet using the port that MS SQL uses. I installed Management Studio on the web server and I was not able to connect to the MS SQL server using it. Somehow the restriction managed to differ what kind of connection it was and restricted it only to not allow SQL connections.

This was quite specific case but hope what people can take from it is how to debug and determine where the issue lays.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.