I have a datatable called table1 with a column called column1 that is an integer.
How can i get the max value of the column with a lambda expression in vb net?
thanks!
I have a datatable called table1 with a column called column1 that is an integer.
How can i get the max value of the column with a lambda expression in vb net?
thanks!
Dim max As Int32 = table1.AsEnumerable().
Max(Function(r) r.Field(Of Int32)("column1"))
or in query syntax, what is often more readable in VB.NET:
Dim values = From row In table1.AsEnumerable()
Select row.Field(Of Int32)("column1")
Dim maxValue As Int32 = values.Max()