Count 10 2 5 1 12
object objSum; objSum = YourDataSet.Tables[0].Compute("Sum(Count)", ""); Your_Footer = (int)objSum;
var sum = table.AsEnumerable().Sum(x=>x.Field<int>("Count")); //Where count is your Column name and table is your table of dataset</int>
DataTable table = YourDataSet.Table[0]; int count = 0; foreach(DataRow dr in table.Rows) { count+= Convert.ToInt32(dr["Count"]); } Your_Footer = count;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)