MSSQL Error 'The underlying provider failed on Open'

前端 未结 30 3192
时光取名叫无心
时光取名叫无心 2020-11-22 09:51

I was using an .mdf for connecting to a database and entityClient. Now I want to change the connection string so that there will be no

30条回答
  •  甜味超标
    2020-11-22 10:33

    When you receive this exception, make sure to expand the detail and look at the inner exception details as it will provide details on why the login failed. In my case the connection string contained a user that did not have access to my database.

    Regardless of whether you use Integrated Security (the context of the logged in Windows User) or an individual SQL account, make sure that the user has proper access under 'Security' for the database you are trying to access to prevent this issue.

提交回复
热议问题