Skip to main content

Posts

Showing posts with the label How to configure connection string in MVC 6 in ASP.NET vNext?

How to configure connection string in MVC 6 in vNext?

You can configure your connection string in " appsettings.json ". i.e. In the below MVC 6  appsettings.json file. Here is  two connections sting, one is default connection " DefaultConnection " and send one is " MVC6DemoContext ". You can see in below JSON file. appsettings.json {   "ApplicationInsights" : {     "InstrumentationKey" : ""   },   "Data" : {     "DefaultConnection" : {       "ConnectionString" : "Server=(localdb)\\mssqllocaldb;Database=aspnet5-WebApplication1-b2a87fa4-3c62-4931-8248-76a6b22a08d1;Trusted_Connection=True;MultipleActiveResultSets=true"     },     "MVC6DemoContext" : {       "ConnectionString" : "Server=myServer;Database=MVC6_Demo;User ID=sa;Password=demo-password; Trusted_Connection=True;MultipleActiveResultSets=true; Integrated Security=false;"     }   },  ...