To calculate the sum of a column in a DataTable use the DataTable.Compute method.
Example of usage
Example of usage
object
sumObject = dtPayment.Compute("Sum(Amount)", "");
Display the result in your Total Amount Label like so:
lblTotalAmount.Text = sumObject.ToString();
No comments:
Post a Comment