dynamic connectionstring

4 posts, 1 answers
  1. Skcr
    Skcr avatar
    6 posts
    Member since:
    Jan 2010

    Posted 18 Feb 2015 Link to this post

    i have more than 1 firebird databases with exactly the same tables and columns

    how can i connect to a different database programmatically ?
  2. Skcr
    Skcr avatar
    6 posts
    Member since:
    Jan 2010

    Posted 20 Feb 2015 in reply to Skcr Link to this post

    still looking for a solution
    any help ?
  3. DevCraft banner
  4. Skcr
    Skcr avatar
    6 posts
    Member since:
    Jan 2010

    Posted 20 Feb 2015 in reply to Skcr Link to this post

    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


  5. Answer
    Doroteya
    Admin
    Doroteya avatar
    502 posts

    Posted 23 Feb 2015 Link to this post

    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.
     
Back to Top