I've been searching for a solution for a few hours now to what seems to be a very simple problem with no luck.
I'm using Visual Studio 2012, VB.net, .Net 4.5, Entity Framework 5, dbContext (generated from the designer) and SQL Server Express to create a web app.
I have 1 "MasterDb" that stores registration information for each client who signs up with my service and allows them to administer their account. It also stores their "ClientId" which is a unique number assigned to each client.
Each client will have their own separate but identical database which will be dynamically created when they sign up. Each database will have a name something like "ClientDb_0001", "ClientDb_0002", etc. The trailing number will be the "ClientId" I mentioned. What I need to do is override the connection string entity framework uses once the user logs in with my dynamically created string so that they can use their own database. I've read some posts talking about passing a connection string to dbContext but I don't understand how this is possible.
The way I currently use ef is as follows:
Using dbContext As New myEntities
Dim res = (from myVals In dbContext.myTable
where myVals.id = someid
How in the world can I pass a connection string to this?
Thanks for any help anyone can provide,