If I have a stored procedure returning a subset of the fields in a table, how do I map it to an entity? If I try to map to an entity with all the fields, then the execution of the stored procedure fails with a message indicating that the datareader is incompatible with the entity. If I define a new entity containing just the fields in the stored procedure, then it requires a mapping to a table. If I do that, then it complains that the two entities can be in conflict.
Since stored procedures returning cursors will not always map directly to tables, then how should this be handled?
stored procedures
cannot add view
The entity model tool appears to be very fragile. I have defined a new view in the database. When I try to add it to the enity model, the new view appears in the selection list but it cannot be added to the entity model with no errors reported. Also, if I have previously added stored procedures to the entity model, then they no longer appear after I try to add the new view.
The view cannot be added without warnings because it has no primary key defined.
The entity key for a view is generated from the columns with NOT NULL constraint.
Also, we don't recommend to use the Update model from Database wizard of EDM Designer.
Instead we recommend to regenerate the model from scratch (this is an issue of Microsoft EDM Designer, mainly).
The entity key for a view is generated from the columns with NOT NULL constraint.
Also, we don't recommend to use the Update model from Database wizard of EDM Designer.
Instead we recommend to regenerate the model from scratch (this is an issue of Microsoft EDM Designer, mainly).