If you encountered this error while running your published website or web service in IIS7:

Message: Sys.WebForms.PageRequestManagerServerErrorException: Cannot open database "[DB_NAME]" requested by the login. The login failed.

This is very simple problem. Please follow this steps:

1. Open SQL Management Studio

2. On the left menu, expand Security then Logins. Check if 'NT AUTHORITY\IUSR' exists. If not then that is the cause of the problem.



3. Right-click on Logins then click New Login...




4. On the General page, click Search...



5. On the next popup window, click Advanced...



6. Then on the following window, click Find Now and find IUSR on the Search Results. Then click OK.



7. Back on the left menu, you'll now see the 'NT AUTHORITY\IUSR' user. Right click on it and click Properties.



8. On the Server Roles page, check on sysadmin.


9. Then on the User Mapping page check on the database name you need access to; and below that on the database role membership make sure to also check on db_owner then click OK.



And you wont see login failed error now.

Are you looking for affordable and reliable shared hosting provider? Do you have problem with your hosting provider? This is your opportunity now, you can get shared hosting provider with very low cost and have great service. For further information, please visit
http://www.asphostportal.com.