1

I'm confused on why I am getting an exception when I call a stored procedure from the entity framework api. The error states:

    The data reader is incompatible with the specified [Model].[SP_Result_Type]. 
A member of the type, [typeName], does not have a corresponding column in the data reader with the same name.

The SP in question is a SELECT command that gets values from (3) different tables and Entity Framework returns the values in a ComplexObject type. By "data reader", I guess the exception is referring to a type created by the EF API. If so, both the "data reader" and the table(s) have the correct variable names, so I don't understand the cause of this exception.

The change would probably be in the designer EF created, but I don't know what to change.

2
  • What database type are you using? SQL Server? Commented Aug 1, 2011 at 12:59
  • @Jethro - Does it matter? How can we make it work with MySql? Commented Jun 5, 2015 at 7:07

2 Answers 2

2

the error is clearly not in the entity/variable names but in the fields, there is a missing column, you should probably update the complex object type definition to either add the missing column or remove the old one no longer present in the db or not returned anymore by the stored procedure you are calling.

hope this helps :)

Sign up to request clarification or add additional context in comments.

Comments

0

If I'm not mistaken if you are using SQL Compact, then EF does not support Stored Procedures with Sql Compact.

"SQL Server Compact does not support stored procedures and views."

Link found here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.