I’ve seen two problems with updating a Stored Procedure after adding it to the entity framework:
- The Function Import created to call the SPROC wasn’t updated (incorrect, out-of-date parameters)
- The Complex Type created for the SPROC’s result set wasn’t updated (incorrect, out-of-date fields)
Updating EDMX model (function import)
- Open the .edmx file (in the GUI designer).
- Right-click in some open space and select “Update Model from Database”.
- Click Finish (when able) on the pop-up window. Your SPROC’s signature should be updated (along with any Function Imports).
Updating stored procedure complex type
-
open the “Model Browser” window while you have the .edmx open.
-
Expand the ContentModel, EntityContainer: …, and then Function Imports nodes. Look for the function import for your stored procedure and double click it. The same window you used to create it will open, but now populated with its data.
-
Click the Get Column Information button (look at the grid below the button to see what will be changed).
-
Click the Update button next to the “Complex” radio button choice.
-
Click OK, and the Complex Type for your result set should be updated.