Reputation: 4692
I'm getting the below error with EF 5 and have researched it on the web vigorously and figured it was simply a mapping issue. Everything I have checked into comes out fine.
Can someone please possibly inform me what the error might be based on the below info???
The data reader is incompatible with the specified 'VisionModel.sSRPTFundexDocCodes1_Test_Result'. A member of the type, 'NumEmployeesatApp1', does not have a corresponding column in the data reader with the same name.
When I debug the below code snippet, right after that is when I get the above error.
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<sSRPTFundexDocCodes1_Test_Result>("sSRPTFundexDocCodes1_Test", subscriberIDParameter, applicationNumParameter);
The parameters going into the stored procedure are OK.
The mapping is just fine. On the left hand side of the mapping is: NumEmployeesatApp
and the right hand side is exactly the same.
I completely deleted my EDMX file and created it from scratch with the same error occurring. When I do a "Get column info" from the function, the column name comes out to what is exactly in the above stored procedure.
The template that is generated off of the EDMX file (Vision) and the stored procedure above have the columns matching exactly.
btw, I'm able to run other INSERT
& SELECT
LINQ queries off of the EF 5 model I have with no problem.
Upvotes: 3
Views: 5477
Reputation: 41
I had the same issue if you are using the stored procedure with an output parameter you need to mark the return type as NONE in function import. This is weird but it works.
Upvotes: 4