You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float)
<pre> System.Nullable<float> totalUnitsOnOrder = (from prod in dbcontext.Votes where prod.BvId == bureauvote select (float)prod.NbrVoix) .Sum();
<pre> var res = dbcontext.Votes.Where(v => v.BvId == bureauvote); var result = res.AsQueryable().Sum(r => r.NbrVoix);
var res = dbcontext.Votes.Where(v => v.BvId == bureauvote).Sum(v => v.NbrVoix);
(float)
where prod.BvId == bureauvote
where prod.BvId = bureauvote
i have found solution , i have done select on table , after i have done foreach on the queryable data
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)