protected void grdTesters_RowDataBound(object sender, GridViewRowEventArgs e) { int sum; if (e.Row.RowType == DataControlRowType.DataRow) { sum = sum + Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "ExecutionTime")); } if (e.Row.RowType == DataControlRowType.Footer) { Label obj = (Label)e.Row.FindControl("Sum"); obj.Text = Convert.ToString(sum); }
Error Use of unassigned local variable 'sum'
int sum=0;
string total = string.Format("{0:0.00}", Convert.ToDouble(datatable.Compute("sum(ExecutionTime)", null)));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)