In case if you want to find the maximum values from the
DataTable
, then the following code can be used, in which
termtest
is DataTable,
total
is the Column of data type
Decimal
Dim RowsInDescending As DataRow() = termtest.select("", "total DESC", System.Data.DataViewRowState.CurrentRows)
Dim MaxTotal As Decimal
If RowsInDescending.Length > 0 Then
MaxTotal = CDec(RowsInDescending(0).Item("total"))
End If