This is very typical error
you receive when your underlying database store is changed and there is no
update made to EDMX file.
For example, I imported a
stored procedure in edmx and saved it. After that I change the stored procedure
and do not update edmx. I run the application and at runtime the error is encountered
as - “the function import cannot be executed because it is not mapped to a
store function”.
This error can be resolved
easily by updating the edmx. Following is procedure to resolve the error –
Open the edmx and open
Model Browser. Model browser can be opened as shown below.
Find the required stored
procedure in model browser. The right click and select option – “Delete from
Model” as shown below –
Now again open the model
browser and find the added stored procedure. Right click on it and select the “Edit”
option as shown below -
“Edit function Import” pop
up will appear. For the selected stored procedure you will find that, return
collection is having the two options which end with “Results1” and “Results”. Out of these two options select Results option and click OK.
This will resolve the
error. Hope it helps.
Cheers…
Happy Importing!!!
Thanks, I used this successfully.
ReplyDeleteNice work. Thanks a lot. That saved me a lot of time :D.
ReplyDeleteThanks mate (y)
ReplyDeleteWorked like a charm. You might want to add, hit UPDATE in your last step when you are editing function import to get the latest columns returned if the SP had some changes made.
ReplyDeleteThanks a lot. worked for me
ReplyDeleteThanks very much!
ReplyDeleteAnd another happy customer. Worked. Thank you!
ReplyDeleteI've tried this but its not working for me. When I follow this, I end up having to run the Generate Database from models command and then I lose the mapping to the stored procedure I brought back in.
ReplyDeleteThank you Thank you Thank you! If I met you in person I'm gonna buy you a coffee :)
ReplyDeleteyes my issues solved thanks
ReplyDelete