question

SerapBircan-3238 avatar image
0 Votes"
SerapBircan-3238 asked JackJJun-MSFT commented

Entity Framwork: This operation requires a connection to the 'master' database... error

Hi friends,

I I added a view to the database and deleted the Entity Data Model, recreated it. I then got the following error: "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.'" By the way, there is "persist security info=True" in the connection string.

Please help!

dotnet-csharpdotnet-entity-framework-coredotnet-entity-framework
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@SerapBircan-3238, Could you provide your connection string text? Based on my search, missing out a semi-colon also will cause the problem. Are you use windows authentication or user authentication?

0 Votes 0 ·

1 Answer

karenpayneoregon avatar image
0 Votes"
karenpayneoregon answered SerapBircan-3238 commented

Try using Integrated Security=True if using windows authentication e.g.

Data Source=localhost\SQLEXPRESS;Initial Catalog=NorthWind2020;Integrated Security=True

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

"Integrated Security=True" gave an error!

0 Votes 0 ·

gave an error! is meaningless.

You can see from the following how I setup a connection for EF Core 5 used here. Connection string stored in appsettings.json




0 Votes 0 ·

There is an "Integrated Security=True" in connection string.

0 Votes 0 ·