Code First entity framework connection string
- by Suneel Dixit
I have 3 class projects in my solutions.
1. MVC4 project
2. Domain
3. Tests
In the MVC4 project I have added a web.config file with the connection string as
<add name="EfDbContext" connectionString="Data Source=.;Initial Catalog=SportsStore;Integrated Security=true;" providerName="System.Data.SqlClient"/>
I have a class by name EfDbContext in Domain project which inherits DbContext.
When I view the website in browser, I get the server not found error.
I debugged the EfDbContext class and found that the Database.Connection.ConnectionString
is set to \SqlExpress with database as EfDbContext.
Why is that?