Changing the database name at runtime

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
larrydhunt
Posts: 10
Joined: Tue 20 Jan 2009 21:40

Changing the database name at runtime

Post by larrydhunt » Wed 21 Jan 2009 14:00

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

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 21 Jan 2009 15:12

This feature will not be available soon.

larrydhunt
Posts: 10
Joined: Tue 20 Jan 2009 21:40

Post by larrydhunt » Wed 21 Jan 2009 23:09

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

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 22 Jan 2009 09:04

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.

Post Reply