Cannot connect to SQL Server from ASP.NET MVC app

Posted by Dan Fergus on Stack Overflow See other posts from Stack Overflow or by Dan Fergus
Published on 2010-05-07T17:24:15Z Indexed on 2010/05/07 17:28 UTC
Read the original article Hit count: 230

Filed under:

I have an ASP.NET MVC app that has on a hosted server for over a year, connecting to SQL Server. I've had to change hosting services, the new one supports MVC 1.0. I've also moved a non MVC ASP app to the same hosting service.

Now, MY MVC based app retturnes this error when I try to validate a user login.

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)

Now, the non-MVC app can access the exact same database and authenticate users just fine. The MVC app, when run from my dev box connects fine. It also run/connects/authenticates without problem when I install and run the site from an internal SQL 2008 server running IIS 7.

I, along with the hosting support techs, am at a loss how the exact same connect string works every where except on the hosted server, and only when run from inside an ASP.NET MVC web app.

Any ideas would be greatly appreciated.

© Stack Overflow or respective owner

Related posts about asp.net-mvc