This is a migrated thread and some comments may be shown as answers.

dynamic connectionstring

3 Answers 48 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Skcr
Top achievements
Rank 1
Skcr asked on 18 Feb 2015, 10:01 PM
i have more than 1 firebird databases with exactly the same tables and columns

how can i connect to a different database programmatically ?

3 Answers, 1 is accepted

Sort by
0
Skcr
Top achievements
Rank 1
answered on 20 Feb 2015, 10:12 PM
still looking for a solution
any help ?
0
Skcr
Top achievements
Rank 1
answered on 20 Feb 2015, 10:42 PM
found it : http://docs.telerik.com/data-access/developers-guide/data-access-domain-model/managing-the-openaccesscontext/data-access-tasks-model-tools-manually-define-context


0
Accepted
Doroteya
Telerik team
answered on 23 Feb 2015, 01:12 PM
Hello Skcr,

The context class generated by default from Telerik Data Access has five overloads of the constructor. One of them is:
public EntitiesModel(string connection)
It allows you to provide the specific connection string with which you want to instantiate the context (either the string itself or the name of the connection string in the .config file).

In the case where the two databases are identical, all you need to do in order to consume the model in the described fashion is to pass either one of the connection strings according to your logic.

I hope this helps. Let us know, if you need further information.


Regards,
Doroteya
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
Data Access Free Edition
Asked by
Skcr
Top achievements
Rank 1
Answers by
Skcr
Top achievements
Rank 1
Doroteya
Telerik team
Share this question
or