Currently, I am writing the following
dt.AsEnumerable.OrderBy(Function(r) If(Microsoft.VisualBasic.Information.IsNumeric(r(“columnName1”)), CDbl(r(“columnName1”)), 0))).CopyToDataTable()
This time, we need to sort not only the value of “ColumnName1”, but also the value of the column named “ColumnName2”. The image is as follows.
OrderBy ColumnName1 ASC, ColumnName2 ASC
At first, I used DataView, but the values of ColumnName1 and ColumnName2 are numbers, String type. so they are sorted by the first digit as 1, 10, 100.
Therefore, I need to add ColumnName2 as a number to the syntax written above, and add it as the ASC of the second name preference, but I don’t know how to do it.
Can you tell me how to do this?
Thank you for reading.