OA and dnn module

7 posts, 0 answers
  1. Filip Salwender
    Filip Salwender avatar
    10 posts
    Member since:
    Feb 2009

    Posted 09 Mar 2010 Link to this post

    Hi, I'd like to use Open Access in dnn module and I've been thinking whether is possible to use open access and still use standard tables installation. ( CREATE TABLE {databaseOwner}[{objectQualifier}MyCompany_MyModule] ).

    But as far as I know it won't be possible because if I reverse map the database OA code assumes that table names will be always the same. So when I'll have table MyCompany_MyModule, the code will assume that the table will always be named this way.

    Any ideas how to use open access and still be able to use standard table installation?

    Thank you for any input.
    Filip
  2. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 12 Mar 2010 Link to this post

    Hello Filip Salwender,

    If you change your table names - or any other property of your relational model, you should start the "update from database wizard" which will update your mapping with the latest stage of your database model.

    All the best,
    Zoran
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. Filip Salwender
    Filip Salwender avatar
    10 posts
    Member since:
    Feb 2009

    Posted 15 Mar 2010 Link to this post

    Hi there,

    Thank you for response.
    I know that. I've been developing with OA for sometime now and I love it.

    Maybe I was not clear about my question.

    When I develop the module and on my development database I'll have for example dbo.MyTable then, OA will look for this table and everything will be OK if I'll change name I will just use wizard to update changes. Thats not the problem.

    But dnn standard for creating tables is CREATE TABLE {databaseOwner}[{objectQualifier}MyTable] so if I want to follow this standard I don't know the final table name, it can be dbo.MyTable or it can be someSchemaName.dnn_MyTable or whatever.

    My question is whether is possible to follow this standard or I'll have to use 'fixed' table names so on every installation of mine module the table name will be dbo.MyTable.

    I hope I described my question.
    Thank you, Filip

  5. Brian
    Brian avatar
    35 posts
    Member since:
    Dec 2007

    Posted 15 Mar 2010 Link to this post

    I would also be interested in how to add a Prefix before all objects in the database.

    example

    dbo.dnn_tblProducts
    dbo.dnn_spGetProducts


  6. Serge
    Admin
    Serge avatar
    375 posts

    Posted 17 Mar 2010 Link to this post

    Hello Brian and Hello Filip,

    Currently OpenAccess has no mechanism of detecting different table names. But you can easily achieve your task by editing the app.config file.

    All you have to do is to find the following tag for each class tag and change it, so that it points to the correct table:

    <extension key="db-table-name" value="your-table-name-here" />
     You can of course use <schema-name>.<table-name> syntax here. They are found in the mapping section under the openaccess section of the app.config. 

    Bear in mind though that these changes will be lost if you update your project with the Reverse Mapping Wizard.

    Greetings,

    Serge
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  7. Brian
    Brian avatar
    35 posts
    Member since:
    Dec 2007

    Posted 17 Mar 2010 Link to this post

    Is there any way we can override the configuration much like we do with the connection strings?

    It would be cool if I could just put the custom config into the web.config.

    I'm thinking the assemblies get enhanced and this might not be possible though.

  8. Serge
    Admin
    Serge avatar
    375 posts

    Posted 19 Mar 2010 Link to this post

    Hello Brian,

     You are correct. There is a workaround however. With OpenAccess you can load the XML configuration file dynamically. You will have to modify the Database() method of the ObjectScopeProvider though. 

    What you have to do is generate a XML file and pass it to one of the constructors of the Database.Get() method. Here is an help article with an example that you can check out.

    Greetings,
    Serge
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
DevCraft banner