When debugging and testing the web application that was developed in-house, I get the error:
Cannot open database "dbname" requested by the login. The login failed.
Login failed for user 'domain\user'
The database is set up with Windows Authentication and tries to use my Windows Account to authenticate with.
Opening "SQL Server Object Explorer" I generate a query to add myself under Security-> users of the database.
CREATE USER [domain\user] FOR LOGIN [domain\user];
I then do:
EXEC sp_addrolemember 'db_owner', 'domain\user'
In the end I right click the account that is now showing under Security-> users and choose "view permissions."
I then get:
No permissions were found for [domain\user] or all existing permissions are open in other windows
Can't see the permission elsewhere, but try to run the application in Visual Studio again. I then end up with the same error as in the beginning.
This database is just hosted via the Visual Studio Project that I need for some testing. It is not hosted on a full SQL Server. There is no SQL Server Management Studio installed. I need to work this out using my Visual Studio 2013 preferably.