I'm new to WCF. Using the Model Browser within my solution I have selected update model from the DB and selected for now just 1 SP. The Sp expects to recieve 1 parameter @UserRoleId and then return a dataset comprising of 4 columns. I have created 2 Entities. The first has a single Property called UserRoleId to correspond to the value expected by the SP. the second entity I have created with 4 properties that correspond to the data being returned by the SP. I have right clicked on my SP and selected 'Add Function Import' and then within this I have selected my SP an selected Entities in the 'return a collection of' and then selected my entity with the 4 properties. This has placed my SP within the Function Imprts directory.
I have an error that states: 'Error 2062: No Mapping specified for instances of the entity set and associatedset in the entitycontainer. I also get an error stating that the Entities in the Model are not mapped. If I then go to the entities and right click and select stored procedure mapping, this only gives me insert, update and delete functions, when my SP is only a Select function so I cannot map the entities.
Can anyone point me in the direction of a good step by step guide on using the model browser to correctly map a Stored procedure that isn't for updating the DB.
Ok.....Think I've managed to get past the above. I have deleted the entities and in moy model I just have Complex type called spName_Result which consists of the columns being returned by the SP. then I have the sp within function Imports and this mapped to return the complex type. I now get no errors, so now how do I expose these to allow calling the SP and retrieving the returned results.
I have attached 2 screen shots which might make things easier to see what I have done so far.
Last edited by Bill Crawley; Mar 10th, 2011 at 06:32 AM.
Reason: Update.....