double total = 0; foreach (DataGridViewRow row in gvpurchase.Rows) { if (!row.IsNewRow && row.Cells["paid"].Value != null) { total += (double)row.Cells["paid"].Value; //Convert.ToInt32(["paid"]); } } lbltotal.Text = total.ToString("N2"); } }
total += (double)row.Cells["paid"].Value;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)