Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stored Procedure & LINQ, Dmbl File unable to interpret the result set

I have several Stored Procedures that when added to my dbml, it seems that behind the scenes LINQ can not interpret the result set and will simply map the result as an int. I then have to create the result class myself which is a pain but also I have to go and change the designer file every time I add to my dbml because it will re-load it and map the result back to an int for each of those stored procedures.

Is this a problem with my Stored procedures that LINQ can't interpret and then create the the result class for me. Or is this a problem with LINQ?

like image 470
Collin Estes Avatar asked Mar 01 '23 00:03

Collin Estes


1 Answers

Do you use a temporary table in your sproc? That causes a problem (the problem is actually SQL's). Here's a blog post about it, solution is to replace the sproc temporarily while adding the sproc to the DBML.

Unfortunately I don't think there is a better solution...

EDIT: Here is someone else with the same problem, and a slightly different solution.

EDIT AGAIN: Here is a much better explanation and a solution that doesn't involve replacing the sproc when your done; It does include additional code in the sproc to detect when FMTONLY has been set and temporarily disable it. Neat idea, I may try it in the future.

like image 82
Chris Shaffer Avatar answered Mar 03 '23 17:03

Chris Shaffer