views:

115

answers:

2

I have problem using IIS 7 and SQL Server 2008. When I trying to show my website using IIS as webserver I get the message "[SqlException (0x80131904): Login failed for user..."

When I using the webserver included in Visual Studio 2010 to show same website there is no problem to access the database.

Why is it working with VS2010 webserver but not with IIS?

+1  A: 

I will try to guess:

You're using windows authentication to access the SQL SERVER and the user of the site's application pool (if you're not impersonating) doesn't have necessary permissions.

If I'm not wrong, the default application user for application pools on IIS7 is NETWORKSERVICE so 2 valid options would be

  • You give necessary permissions to this user
  • You change the app pool's user to any with necessary permissions
Claudio Redi
A: 

Add the IIS Group in the SQL SERVER "IIS_WPG" to have access to the DataBase.

GeoAvila