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

Add a View to the model

5 Answers 48 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.
Erik
Top achievements
Rank 2
Erik asked on 11 Jul 2011, 02:27 PM
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

5 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 13 Jul 2011, 10:25 AM
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!

0
Allen
Top achievements
Rank 1
answered on 17 Dec 2014, 09:28 AM
No primary key, what should I do?
Take a look at this picture:here
0
Doroteya
Telerik team
answered on 18 Dec 2014, 02:15 PM
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.
 
0
Allen
Top achievements
Rank 1
answered on 19 Dec 2014, 02:59 AM
Yes,Thank
0
Allen
Top achievements
Rank 1
answered on 19 Dec 2014, 03:00 AM
Yes,Thank
Tags
Getting Started
Asked by
Erik
Top achievements
Rank 2
Answers by
Alexander
Telerik team
Allen
Top achievements
Rank 1
Doroteya
Telerik team
Share this question
or