Add a View to the model

6 posts, 0 answers
  1. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 11 Jul 2011 Link to this post

    Hello,

    When I add a view i get an error that there is no primary key. when I select the primary (via the model) key I get an error that it cannot be a key on a nullable column, witch it's not.

    So, how can I add the view? 

    Greetings,

    Erik
  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 13 Jul 2011 Link to this post

    Hello Erik,

    Normally when you select an identity for a class mapped to a view, the identity property should be mapped to a not-nullable column. This is because the identity should guarantee uniqueness of the objects, which is not possible without at least one not-nullable primary key column. This is a check we perform for each domain class, and if we detect that all columns mapped to the identity members are nullable, the aforementioned error is generated. This error does not prevent your project from building, but is there to warn you that there might be something wrong in the model.

    If you are sure that your identity member is capable of providing uniqueness for all records, you can just ignore the error and continue working with your application, there should be no runtime problems because of that.

    Kind regards,
    Alexander
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
  4. Allen
    Allen avatar
    42 posts
    Member since:
    Nov 2014

    Posted 17 Dec 2014 in reply to Alexander Link to this post

    No primary key, what should I do?
    Take a look at this picture:here
  5. Doroteya
    Admin
    Doroteya avatar
    502 posts

    Posted 18 Dec 2014 Link to this post

    Hello Allen,

    It seems that the your question in this topic is the same as the one discussed in the The object name 'voa_keygen' is invalid ??? topic. If so, you can kindly find the answer in this post.

    I hope this helps.


    Regards,
    Doroteya
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
  6. Allen
    Allen avatar
    42 posts
    Member since:
    Nov 2014

    Posted 18 Dec 2014 in reply to Doroteya Link to this post

    Yes,Thank
  7. Allen
    Allen avatar
    42 posts
    Member since:
    Nov 2014

    Posted 18 Dec 2014 in reply to Doroteya Link to this post

    Yes,Thank
Back to Top
DevCraft banner