Change the connection string in the Code First Entity Framework

asp.net-mvc c# ef-code-first entity-framework

Accepted Answer

The constructor of the connection string or its name may acceptDbContext . When using the default constructor, the connection string with the same name as the name of your derived context class is searched for; if it is not found, the following connection string is used:

Data Source=.\SQLEXPRESS; Integrated Security=True; MultipleActiveResultSets=True

the same as your context class's database name.

31
8/10/2011 1:40:34 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow