Mark Mark - 3 months ago 60
ASP.NET (C#) Question

This operation requires a connection to the 'master' database

I have suddenly started getting an error in my asp.net MVC 4 web application.

The error is:

This operation requires a connection to the 'master' database. Unable to create a connection to the 'master' database because the original database connection has been opened and credentials have been removed from the connection string. Supply an unopened connection.


Nothing has changed in the code - and database access is fine throughout the rest of the code.

It stops on this line:

var filteredContacts = dc.EAContactLists.Where(o => teams.Contains(o.Team)).ToList();


I am lost on this one.

Thanks for any advice,

Mark

Answer

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

Hope this helps.