views:

726

answers:

1

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?

+4  A: 

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.

Chris Shaffer
bummer, thanks for the link. This is exactly what is happening to me.
Collin Estes