I was using MVC5 Entity Framework for a long time with connection string in web.config that look like this:
<connectionStrings>
<add name="GuestContext"
connectionString="Data Source=DAVESQLSERVER\SQLEXPRESS;Initial Catalog=NexDec12;Integrated Security=False;User ID=sa;Password=changeME!;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False"
providerName="System.Data.SqlClient" />
</connectionStrings>
I am trying to figure out how to do this in the appsettings.json file. I am learning MVC6 using Rick Anderson's tutorial here.
Rather than use the built in SQL Server in VS or IIS10 I want to connect to my external SQL Server Express. I have tried this but it doesn't work, says the login is invalid for user sa (so it's trying to use the correct username?) I feel like it isn't using the correct password but I don't know how to construct a connnection string for the new MVC6 json config format.
I tried this:
"Data": {
"DefaultConnection": {
"ConnectionString": "Server=DAVESQLSERVER\\SQLEXPRESS;Database=MovieTut;Trusted_Connection=True;MultipleActiveResultSets=true; Integrated Security=false;User ID=sa;Password=changeME!"
}