The underlying provider failed on Open

When you get the following error message in Microsoft Visual Studio 2013 check the inner exception.

System.Data.Entity.Core.EntityException was unhandled
  Message=The underlying provider failed on Open.

The inner exception gives you detailed information on the real cause of the error. Most of the time the inner exception is the following:

InnerException: System.Data.SqlClient.SqlException
       Message=Cannot open database “…” requested by the login. The login failed.
Login failed for user ‘…’.
       Source=.Net SqlClient Data Provider

Check the rights of the user. Most likely the specified user does not have access to the database.


Join the Conversation

1 Comment

  1. Thanks for this – actually found it quite useful, though my inner issue was different.

Leave a comment

Your email address will not be published. Required fields are marked *