I am trying to connect to SQL server through an asp.net page and I am getting this error: Cannot open database "dbname" requested by the login. The login failed. Login failed for user 'username'. And when I try to login directly at SQL using the same credentials it does connect successfully. And the username and password set in the webconfig are correct.
I tried setting a new password, remove the user from the database and add it again but it doesn't work through web only through SQL.