i have a form from all costumers and i also have all payments now i need a sum field for all payments from a DataGridView
Jump to Post
Assuming that the datagridview is bound to a datatable, then you can use the DataTable.Compute method.
Dim total As Decimal = CDec(dt.Compute("Sum([Payments])", "True"))
Where "dt" is the name of the datatable. I assumed that the column name in the datatable for "paymenents" is "Paymenents".
All 2 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.