Connection ID issue

2 posts, 0 answers
  1. Jin
    Jin avatar
    80 posts
    Member since:
    Jun 2012

    Posted 05 Sep 2012 Link to this post

    I create two Domain classes to map two different table in one project with the same connection id. After I run my application, I found when I retrieve data from one domain class, it works fine and retrieve data from another domain class, it will throw exception:
    Type is enhanced and registered, but not available from the database class meta data. This can be caused by a wrong connection id or configuration.

    Then I modify the connection id as a different value in one domain class and copy a connection string with modified connection id, all works fine. My concern is whether every domain class need to use a unique connection ID to map?
  2. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 10 Sep 2012 Link to this post

    Hello Jin,

     The connection string is not bound to a domain class but a domain model instead.You should have as many connection strings as models (.rlinq files) that you have in your application that access the same database. There is also an approach that allows for expanding the model metadata during runtime without changing the connection string and ultimately allowing to work with only one connection string in all modules  of an application. Here is a link to a help article describing the mentioned approach.

    Greetings,
    Zoran
    the Telerik team
    Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
  3. DevCraft banner
Back to Top