Page 1 of 1

Cannot Add Views or Stored Procedure to the Model

Posted: Tue 25 Jan 2011 17:59
by nssidhu
I am not able to Add View or Stored Procedure to the Model, even though i am able to select View, but after selecting it nothing happens and the dialog box closes. Upon opening the .edmx i don't see anything related to View

Posted: Wed 26 Jan 2011 12:49
by AndreyR
Are you using .edmx model and the Update Model from Database wizard?
If so, this is a known issue. Wizard performs an attempt to infer Entitiy Key using non-nullable columns. If it fails, view is added to the model as a commented XML. Open the model in the XML Editor you like, uncomment the view, and set the correct Entity Key.
Please provide us the steps to reproduce the problem if it's not the case.

Posted: Tue 01 Feb 2011 15:52
by nssidhu
I am doing exactly as you mentioned., but when opening the .edmx in xml editor i don't see any commented code relating to the view that i was trying to import

Posted: Thu 03 Feb 2011 10:32
by AndreyR
Could you please specify the version of the Silverlight libraries?
Are you using classic code generation, POCO, or Self-Tracking Entites?

I have extact same issue.

Posted: Tue 12 Jul 2011 23:22
by CaptinTripps
I posted a new thread in the forum before seeing this thread. I am having an identical issue.

Can you please list all the attributes that a view must have in ordedr to be added by the wizard properly.

Thanks
Mr Tripps

Posted: Wed 13 Jul 2011 08:50
by AndreyR
CaptinTripps, generally, the view should contain some not null columns. However, there are no specific rules that guarantee that the view will definitely be added. Entity Data Model Wizard seeks for the Primary Key first, and if it doesn't find any, it attempts to infer the Entity Key from not null columns.