When you work with Microsoft entity framework code first approach Entity framework creates your database and put it some location according to its default behavior. But most of the time we want to see our database into our local SQL Server. So here I’m showing the simplest way to force the entity framework to create your database into SQL Server installed to the local system.

Open solution explorer. Press [Ctrl + Alt + L] to open solution explorer and find out the App.config file.

Open App.config file from solution explorer.


App.config file will be like this. See the space below the configSections. We’ll add our customized connection string to force our database to be create into our SQL Server.

Add this code below the configSections.

Here is the short description for this connection string:

This is how you can force entity framework to create database into local SQL Server.