C# 实体框架中的EntityCommandExecutionException

C# 实体框架中的EntityCommandExecutionException,c#,entity-framework,C#,Entity Framework,当我从实体框架api调用存储过程时,我不明白为什么会出现异常。错误状态为: 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. 所讨论的SP是一个SELECT命令,它

当我从实体框架api调用存储过程时,我不明白为什么会出现异常。错误状态为:

    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.
所讨论的SP是一个SELECT命令,它从(3)个不同的表中获取值,实体框架以ComplexObject类型返回值。通过“数据读取器”,我猜异常是指EFAPI创建的类型。如果是,那么“数据读取器”和表都有正确的变量名,因此我不理解出现此异常的原因


更改可能在创建的designer EF中,但我不知道要更改什么。

错误显然不在实体/变量名称中,而是在字段中,缺少一列,您可能应该更新复杂对象类型定义,以添加缺少的列,或删除数据库中不再存在的或正在调用的存储过程不再返回的旧列


希望这有帮助:)

如果我没有弄错,如果您使用的是SQL Compact,那么EF不支持使用SQL Compact的存储过程

“SQL Server Compact不支持存储过程和视图。”


找到链接

您使用的数据库类型是什么?SQL Server?@Jethro-这有关系吗?我们如何让它与MySql一起工作?