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

Use Forward Mapping after Reverse Mapping

1 Answer 46 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.
Richard Bosworth
Top achievements
Rank 1
Richard Bosworth asked on 03 Jun 2010, 03:43 PM
Hi,

I have used OpenAccess to reverse map my database from the previous version of my application. This is fine and seems to work perfectly. However, is it possible that I could, say, add a new property in my "Developer" class and it will be reflected in the database?

Thanks,
Richard Bosworth

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 04 Jun 2010, 05:15 PM
Hello Richard Bosworth,

There are two approaches that can be used in this case:
1. Using Forward Mapping:
- Add the new property to the class;
- Set the UpdateDatabase property of the project to True;
- Set the db-do-not-create-table setting in the app.config file to false for the Developer class;
- Rebuild the project; Now the new column should show up in the table;
- You could set the db-do-not-create-table setting back to true once the database is updated. This will prevent from other unwanted changes in the future;

2. Using reverse mapping (the recommended way):
- Add the new column to the table;
- Run the Reverse mapping wizard;
- Click on the Merge button;
- The Schema merge summary dialog will be shown where the differences will appear;
- Click on the Merge button;
- When you finish with the settings click on the Generate and Save config button;
- A new property corresponding to the added column will be generated in the class;
Hope that helps.

Greetings,
Damyan Bogoev
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
Richard Bosworth
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or