tags:

views:

79

answers:

1

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.

A: 

Are you using SQL authentication or Windows authentication in your connection string? If you're using Windows authentication the default account used for IIS apps is NETWORK SERVICE. You would need to allow this user access to your database.

You might want to check what user the application pool is running under. It's possible the non-MVC application is running under a different user than the MVC application.

Paul Mrozowski
I'm using SQL Authentication. I will check the app pool assignments though...
Dan Fergus