Cannot Create oData Service From View

3 posts, 1 answers
  1. DEX
    DEX avatar
    7 posts
    Member since:
    Nov 2012

    Posted 03 May 2013 Link to this post

    So I have Oracle in the backend and an OpenAccess ORM generated with a View in it. The View in the database does NOT have a PK constraint but the main underlying table does and Oracle will not let me add a PK to the view because it recognizes the PK from the underlying table and tells me that I can only have one PK. According to the OpenAccess documentation........

    "By default, if your view doesn't have a primary key, the corresponding entry in the Add OpenAccess Service wizard is disabled. If you want to expose a view through a service, you need to specify a primary key in the Visual Designer."

    So I did this. The Visual Designer shows the little key signifying that the column is a PK. But I sill cannot add the View to the entity collection when trying to create an oData v3 service. I click and click and click on the little checkbox to add it to no avail. I tried clearing Visual Studio cache. I tried rebuilding the solution. I tried I tried clicking harder. I tried crossing my arms and wiggling my nose. I tried a little voodoo magic. Apparently my kung fu is weak today.

    Please advise.
  2. Answer
    Viktor Zhivkov
    Admin
    Viktor Zhivkov avatar
    291 posts

    Posted 07 May 2013 Link to this post

    Hi DEX,

    You will have to rebuild the project that contains your RLINQ model before Add OpenAccess Service wizard will be able to see the changes that you have made.
    Additionally there can be other issues with the types that you are trying to expose. You can check the validation messages that Add OpenAccess Service wizard generates for each entity that does not pass the validation step by hovering the entity row and inspecting the message in the tooltip that appears.
    There is one more thing to consider when working with views - you will not be able to insert, update and delete any items coming from the views.

    Please let us know if you were able to resolve the issue and if you need any further assistance you are welcome to ask your questions either here in the forums or in our customer support system.

    Regards,
    Viktor Zhivkov
    the Telerik team
    Using Encrypted Connection Strings with Telerik OpenAccess ORM. Read our latest blog article >>
  3. DevCraft banner
  4. DEX
    DEX avatar
    7 posts
    Member since:
    Nov 2012

    Posted 07 May 2013 Link to this post

    Awesome! You rock!

    I was unaware of the tooltip. I hovered over the row and the tooltip told me that the view had a nullable char which is incompatible with WCF Data Services. I changed the database to not allow nulls for that column, regenerated the model, and successfully created the oData service.

    Thank you so much.
Back to Top