If tabletoread is a datatable, then sort before getting the records
adam_k
Practically a Posting Shark
803 posts since Jun 2011
Reputation Points: 256
Solved Threads: 149
If tabletoread is a datatable, then sort before getting the records
yeah adam_k is right, for addition you can use SQL Order By
statement, for example:
this one sort your data by date in ascending order
SELECT * FROM [table_name]ORDER BY [Date]
this one sort your data by date in ascending order
SELECT * FROM [table_name] ORDER BY [Date] DESC
aldeene
Junior Poster in Training
70 posts since Jul 2011
Reputation Points: 10
Solved Threads: 3
You can use Sort method of list.
....
listOfRows.Sort(AddressOf Comp)
...
End Sub
'Sort on 1st column
Shared Function Comp(ByVal v1 As DataRow, ByVal v2 As DataRow) As Integer
If v1(0) > v2(0) Then
Return 1
Else
If v1(0) < v2(0) Then
Return -1
Else
Return 0
End If
End If
End Function
__avd
Posting Genius (adatapost)
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241