Select max id in datatable

MTmace

Member
Joined
Feb 1, 2005
Messages
9
Programming Experience
Beginner
How would I select the max value of a datatable?

intMaxID = Me.dsLossNotice.Tables("NameAddress").Select(???)
 
You would need to use the DefaultView to Sort the rows and then take the first:
VB.NET:
myDataTable.DefaultView.Sort = "ID DESC"

intMaxID = myDataTable.DefaultView(0)("ID")
 
Back
Top