System.Data.SqlClient.SqlException: 'Cannot open database "StockSystemdb." requested by the login. The login failed.
Login failed for user 'MicrosoftAccount\MyEmail'.'
Any fix?
System.Data.SqlClient.SqlException: 'Cannot open database "StockSystemdb." requested by the login. The login failed.
Login failed for user 'MicrosoftAccount\MyEmail'.'
Any fix?
Did you observe the same behavior when you used Windows 10?
Are you able to login with the same credential in the SQL Management Studio?
Hi uzairakhalwaya-2700,
How are things going? Were the answers helpful?
Please feel free to let us know if you have any other question. If the post in the thread is helpful, you could kindly accept it as answer.
Best Regards,
Amelia
Well, you would need to add MicrosoftAccount\MyEmail as a user in the database StockSytsemDb.
It could have helped if you had included what troubleshooting you have performed, and some information why you don't expect to get this error.
Hi uzairakhalwaya-2700,
Welcome to Microsoft Q&A.
Could you please try to use user 'MicrosoftAccount\MyEmail' to connect to SQL Server database and see if there are any detailed error message?
And what the connection string are you using?
Please make sure user 'MicrosoftAccount\MyEmail' exists under database->security->users.
Best Regards,
Amelia
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
37 people are following this question.