This operation requires a connection to the 'master' database

前端 未结 9 731
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 19:28

I have suddenly started getting an error in my application.

The error is:

This operation requires a connection to the \'master\' database. Una

相关标签:
9条回答
  • 2021-01-03 20:04

    Make sure you aren't running Fiddler. Temporarily disabling traffic capture with F12 resolved the issue for me.

    0 讨论(0)
  • 2021-01-03 20:08

    For me the issue was that my password contained an & sign.

    0 讨论(0)
  • 2021-01-03 20:09

    Try setting Persist Security Info = True in your connection string.

    Hope this helps.

    0 讨论(0)
  • 2021-01-03 20:14

    Hello actually this problem persist if you are trying to make changes in the schema like creating the table or altering some object...

    And you don't have privileges to do that..

    If you are working with MVC and your database already exit in the server than this problem can be solved with the code

    Database.SetInitializer<EmployeeContext>(null);
    

    just add this code in the Global.asax file in the application_start Event method.

    0 讨论(0)
  • 2021-01-03 20:14

    I am so stupid. I faced the same error and then I realized that I was running the update-database -verbose command in Package Manager Console in Release mode when I hadn't configured the transformations for release mode.

    Here is the connectionstring format that worked for me in Debug mode.

    Password=dumbeldore;Persist Security Info=True;User ID=johnmcclain;Initial Catalog=DB_diehard400;Data Source=killthatbill;

    • sensitive info in the connectionstring edited for security reasons. Please follow only the format.
    0 讨论(0)
  • 2021-01-03 20:17

    Add Integrated Security=True for windows authentication.This worked for me.

    0 讨论(0)
提交回复
热议问题