At runtime, can Entity Framework connect to several databases (with the same schema)?

asp.net asp.net-mvc entity-framework

Popular Answer

You can simply change the database if you use an EntityConnection in the constructor of your entities object.

EntityConnection con = new EntityConnection(connString);
con.ChangeDatabase(dbName);
using (Entities context = new Entities(con))
{
    // Some code here
}
8
8/10/2009 9:53:01 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