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

OA and dnn module

6 Answers 71 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Filip Salwender
Top achievements
Rank 1
Filip Salwender asked on 09 Mar 2010, 06:20 AM
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

6 Answers, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 12 Mar 2010, 08:48 AM
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.
0
Filip Salwender
Top achievements
Rank 1
answered on 15 Mar 2010, 02:21 PM
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

0
Brian
Top achievements
Rank 2
answered on 15 Mar 2010, 03:29 PM
I would also be interested in how to add a Prefix before all objects in the database.

example

dbo.dnn_tblProducts
dbo.dnn_spGetProducts


0
Serge
Telerik team
answered on 17 Mar 2010, 03:50 PM
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.
0
Brian
Top achievements
Rank 2
answered on 17 Mar 2010, 07:56 PM
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.

0
Serge
Telerik team
answered on 19 Mar 2010, 05:25 PM
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.
Tags
Getting Started
Asked by
Filip Salwender
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Filip Salwender
Top achievements
Rank 1
Brian
Top achievements
Rank 2
Serge
Telerik team
Share this question
or