Posted By: Anonymous
I have created a web service which is saving some data into to db. But I am getting this error:
Cannot open database “test” requested by the login. The login failed. Login failed for user ‘xyzASPNET’.
My connection string is
Data Source=.SQLExpress;Initial Catalog=IFItest;Integrated Security=True
Well, the error is pretty clear, no? You are trying to connect to your SQL Server with user “xyz/ASPNET” – that’s the account your ASP.NET app is running under.
This account is not allowed to connect to SQL Server – either create a login on SQL Server for that account, or then specify another valid SQL Server account in your connection string.
Can you show us your connection string (by updating your original question)?
UPDATE: Ok, you’re using integrated Windows authentication –> you need to create a SQL Server login for “xyzASPNET” on your SQL Server – or change your connection string to something like:
If you have a user “xyz” with a password of “top$secret” in your database.