I am going through the MvcMusicStore tutorial on the www.asp.net website.
I am able to use Entity Framework Core 2.0 and migrations to create a DB in localDb. Here is the connection string from that in appsettings.json:
When ever I do these tutorials I usually at this point once the DB is created and everything works switch to SQL Server Express, because this is how I actually develop my projects.
So Entity Framework checks the new connection string, doesn't see the DB exists, and creates the new DB based on the Model.
But I can't seem to get the connection string to SQL Express working.
Here is what I have tried so far:
"MvcMovieContext": "Data Source=.\\SQLEXPRESS;Initial Catalog=MvcMovie;Integrated Security=True;MultipleActiveResultSets=true"
Both give the same result. The dreaded message:
SqlException: Cannot open database "MvcMovie" requested by the login. The login failed. Login failed for user 'Domain\smiller'.
I installed SQL Server Express in Mixed Mode so Windows Authentication works and I made my 'Domain\smiller' account a DbCreater in Server Roles.
Just can't seem to get it.
I needed to run:
I went through this last year: Why is dotnet ef not able to create a database against SQL Server Express?
It seems I never learn.