Chapter 7 PTORequest Stored Procedures Issue
I was unable to drag and drop the Stored Procedures for PTORequest in the ORM. The error message "one or more selected database objects return a schema that does not match the schema of the target data class.Nothing has been added to the designer." is returned. This excludes PTORequestSelectByENTUserAccountIdYear that should be dropped onto the Methods pane.
I used the Chapter 7 download scripts to create tables and the stored procedures. The Tables script does not create the Holiday table, but the Stored Procedure script does create Holiday table.
I finally discovered that the stored procedures for PTORequest are missing the "Cancelled" field in the list of fields to be returned. I altered the SelectAll and SelectByID stored procedures in SQL Server inserting "Cancelled"; these two SP can now be dragged and dropped in the ORM onto PTORequest. I needed to exit out of both VS and SQL SMS after the alter, since the Refresh did not recognized the alter in VS.
I'm going to make the same change to all the other PTORequest stored procedures and hope they can also be dragged and dropped.
The SP samples on pages 254 through 256 do not include the Cancelled field. The stored procedures in the final download script file also do not have the Cancelled field.
If someone has found another approach to this issue, I interested in hearing about it.
Tom
|