Is there a way to arrange the date in order?
I tried the below code it isn’t working for date:
dt.DefaultView.Sort = “[Date] DESC”
dt = dt.DefaultView.ToTable
Thank you xoxo
Hi @sangasangasanga,
Use below LINQ code to sort the datatable
(From p In dataTable Order By DateTime.ParseExact(p.Item("Date").ToString, "d MMM yyyy", System.Globalization.CultureInfo.InvariantCulture) Descending Select p).CopyToDataTable
Regards,
Arivu
This will only work if your datatable column is of type datetime or date.