We have two columns in a DataTable
, like so:
COL1 COL2
Abc 5
Def 8
Ghi 3
We're trying to sort this datatable
based on COL2
in decreasing order.
COL1 COL2
ghi 8
abc 4
def 3
jkl 1
We tried this:
ft.DefaultView.Sort = "COL2 desc";
ft = ft.DefaultView.ToTable(true);
but, without using a DataView
, we want to sort the DataTable
itself, not the DataView
.