Reputation: 850
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 and my stored procedure output as below
Where i am doing mistake?
Upvotes: 1
Views: 1795
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