【问题标题】:A member of the type, 'CustomerID', does not have a corresponding column in the data reader with the same name类型的成员“CustomerID”在数据读取器中没有同名的对应列
【发布时间】:2014-05-29 06:10:37
【问题描述】:

我正在尝试使用以下代码使用实体框架调用 mysql 存储过程 错误:

数据读取器与指定的“MangerModuleModel.collection”不兼容。类型的成员“CustomerID”在数据读取器中没有同名的对应列。

public virtual List<collection> Getcollection()
{
    string SQLQuery = "call MangerModule();";
    var objectContext = ((IObjectContextAdapter)db).ObjectContext;
    List<object> listobj = new List<object>();
    List<collection> data = objectContext.ExecuteStoreQuery<collection>(SQLQuery).AsQueryable().ToList();
    return data;
}

下面显示错误 我的存储过程输出如下

我在哪里做错了?

【问题讨论】:

    标签: entity-framework


    【解决方案1】:

    试试这个

    public class columns
    {
    
            public double TotalAmount { get; set; }
            public double Dayamount { get; set; }
            public double monthamount { get; set; }
            public double yearamount { get; set; }
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-04
      相关资源
      最近更新 更多