Link to home
Start Free TrialLog in
Avatar of David D
David DFlag for Norway

asked on

Setting connection string for Entity Framework at runtime vb.net

Hi,

I have a class made with Entity Framework designer.

I have a test and production database that's identical.

I want to switch between test and production at runtime by changing the connection string.

How can I do this in VB.net ?
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of David D

ASKER

Hi Eric,

The trouble is that I'm using the class generated by the EF Designer.

There is no way I can see to use the connection string as a parameter to that class.
it is in your app.config file
Avatar of David D

ASKER

Yes, I know.

But it doesnt help much on runtime.

Anyways I found a solution myself about this.