user123
user123

Reputation: 850

A member of the type, 'CustomerID', does not have a corresponding column in the data reader with the same name

I am tring to call the mysql stored procedure using entityframework using below code error:

The data reader is incompatible with the specified 'MangerModuleModel.collection'. A member of the type, 'CustomerID', does not have a corresponding column in the data reader with the same name.

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;
}

It's showing below error enter image description here and my stored procedure output as below

enter image description here

Where i am doing mistake?

Upvotes: 1

Views: 1795

Answers (1)

stpdevi
stpdevi

Reputation: 1114

Try this

public class columns
{

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

}

Upvotes: 1

Related Questions