I have DataTable
Name Date
bbb 01/01/2011
bbb 01/01/2012
aaa 01/01/2010
aaa 01/01/2011
bbb 01/01/2013
aaa 01/01/2012
bbb 01/01/2010
ccc 01/01/2010
aaa 01/01/2013
ccc 01/01/2012
ccc 01/01/2011
I need sort this table sort by name and every name by date:
Name Date
aaa 01/01/2010
aaa 01/01/2011
aaa 01/01/2012
aaa 01/01/2013
bbb 01/01/2010
bbb 01/01/2011
bbb 01/01/2012
bbb 01/01/2013
ccc 01/01/2010
ccc 01/01/2011
ccc 01/01/2012
How to sort DataTable in c#?
I've tried the following:
DataView dv = dt.DefaultView;
dv.Sort = "col1 desc";
DataTable sortedDT = dv.ToTable();
but this sort only by 1 column...