Property name doesn't match when saved to DB

Thread is closed for posting
2 posts, 0 answers
  1. Chris
    Chris  avatar
    42 posts
    Member since:
    Apr 2009

    Posted 28 Sep 2011 Link to this post


    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.

  2. Kosta Hristov
    Kosta Hristov avatar
    13 posts

    Posted 03 Oct 2011 Link to this post

    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. 

    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 >>

Back to Top