views:

2805

answers:

5

I am having a problem with deploying a ASP.NET V2 web application to our deployment environment and am having trouble with the sql server setup .

When I run the website I get a Login failed for user 'MOETP\MOERSVPWLG$'. error when it tries to connect to the database.

This seems to be the network service user which is the behaviour I want from the application but I don't seem to be able to allow the network service user to access the database.

Some details about the setup. IIS 6 and SQL Server 2005 are both setup on the same server in the deployment environment. The only change from the test setup I made is to point the database connection string to the new live database and of course copy everything over.

My assumption at this point is that there is something that needs to be done to the SQL server setup to allow connections from asp.net. But I can't see what it could be.

Any Ideas?

A: 

Make sure there is a login created for the user you are trying to log in as on the sql server.

Chris Westbrook
A: 

There's a few different things it could be.

Are you using integrated windows authentication? If so, you need to make sure the user ASP.net is running as can talk to the database (or impersonate one that can).

Does the web server have permission to talk to the database? Sometimes a web server is deployed in a DMZ.

If you are using a SQL Server login, does that same login exist on the production server with the same permissions?

Dana
+1  A: 

It sounds like you're able to connect to the database alright and you're using integrated windows authentication.

With integrated windows authentication your connection to your database is going to use whatever your application pool user identity is using. You have to make sure that the user identity that asp.net is using is on the database server.

Min
+1  A: 

If it is a fresh install not everything may be setup. Check SQL Server Configuration Manager, http://msdn.microsoft.com/en-us/library/ms174212.aspx. Step by step instructions http://download.pro.parallels.com/10.3.1/docs/windows/Guides/pcpw_upgrade_guide/7351.htm.

Leah
+1  A: 

The user name you've indicated in your post is what the Network Service account on one machine looks like to other machines, ie "DOMAIN\MACHINENAME$".

If you are connecting from IIS6 on one machine to SQL Server on another machine and you are using Network Service for the application pool's process identity then you need to explicitly add 'MOETP\MOERSVPWLG$' as a login to the SQL Server, and map it to an appropriate database user and role. Type that name in exactly as the login name (minus quotes, of course).