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

Property name doesn't match when saved to DB

1 Answer 47 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chris
Top achievements
Rank 1
Chris asked on 28 Sep 2011, 01:37 PM
Hi,

I found a bug that's little annoying.
First, create a model and add properties, for example, "Name", and "Desc".
Create the DB from the model.
The property name will be renamed to "nme" and "dsc" in the DB.
I found two cases where it renames, but there could be more.
The mismatch will eventually be problematic when you read db from scratch.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Kosta Hristov
Telerik team
answered on 03 Oct 2011, 01:12 PM
Hello Chris,

In fact this is the expected behavior at the moment. Since "Name" and "Desc" are keywords in some databases, OpenAccess evades any possible issues related to this by simply renaming the table columns automatically.

This is something we plan to address in one of the future releases of OpenAccess. As a workaround, you can simply change the column name in the local table. You can do this by right-clicking on the class in the Visual Designer and selecting Edit Table. This will open the Edit Table dialog which will allow you to make modifications to the table definition. 

Note that in order to do this, the class should be mapped to a table. If it is not already mapped, you can right-click on the domain class and select Map To Table. This will map the class to a default table which you can edit prior to forward mapping the whole model to the database.
Hope this helps. 

Regards,
Kosta Hristov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's SQL Server Community Awards. We are competing in TWO categories and every vote counts! VOTE for Telerik NOW >>

Tags
Design Time (Visual Designer & Tools)
Asked by
Chris
Top achievements
Rank 1
Answers by
Kosta Hristov
Telerik team
Share this question
or