Page 1 of 1
Changing the database name at runtime
Posted: Wed 21 Jan 2009 14:00
by larrydhunt
In the code generate CrmDataContext class. It appears that the database name is hardcoded, i.e.:
Is there a way to change the database name at runtime? Changing the connection string doesn't seem to help.
Thanks,
Larry
Posted: Wed 21 Jan 2009 15:12
by AndreyR
This feature will not be available soon.
Posted: Wed 21 Jan 2009 23:09
by larrydhunt
If I manually edit the CrmDataContext class and remove the database name from the Table Name attributes, i.e. change to . Then the connection string database name is used. Is this an acceptable approach?
Thanks,
Larry
Posted: Thu 22 Jan 2009 09:04
by AndreyR
You can edit code manually to work with another database, this is an acceptable approach.
My previous answer dealed with changing ConnectionSting in the current DataContext in runtime.