views:

89

answers:

2

Hi:

For debugging purpose, I backedup one of QA database and restored to local machine. Since it is in my local machine, I just want to connect to it using Integrated Security=True in my asp.net application. But I am getting following error:

Cannot open database "db1" requested by the login. The login failed. Login failed for user "DEV-LPTP-1784\ASPNET".

Any thoughts?

Thanks.

+2  A: 

Delete and recreate database login you use. After db restore the database user has the same name, but inner SQL Server id is different, so SQL Server thinks that server login "DEV-LPTP-1784\ASPNET" is different than db user "DEV-LPTP-1784\ASPNET"

Lukasz Lysik
A: 

The user that ASP.NET is running under does not have access to that database. You can either grant that user access via SQL Management Studio, or change your connection string to use a specific username and password.

Jason Berkan