Code First entity framework connection string

Posted by Suneel Dixit on Stack Overflow See other posts from Stack Overflow or by Suneel Dixit
Published on 2012-10-08T03:05:50Z Indexed on 2012/10/08 3:37 UTC
Read the original article Hit count: 200

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?

© Stack Overflow or respective owner

Related posts about asp.net-mvc-3

Related posts about frameworks