You can't sort DataTable directly,
for to sort DataTable convert it to GrideView
or convert it into DataView
here is the sample code that may helps you.
DataTable dt = new DataTable();
DataRow dr;
dt.Columns.Add(new DataColumn("IntegerValue", typeof(Int32)));
dt.Columns.Add(new DataColumn("StringValue", typeof(string)));
dt.Columns.Add(new DataColumn("CurrencyValue", typeof(double)));
for (int i = 0; i < 5; i++)
{
dr = dt.NewRow();
dr[0] = i;
dr[1] = "Item " + i.ToString();
dr[2] = 5.23 * ((5-i) + 1);
dt.Rows.Add(dr);
}
DataView dv = new DataView(dt);
dv.Sort = "CurrencyValue";
dt = dv.ToTable();
sort property of DataView takes string type, that contains the column name followed by "ASC" (ascending) or "DESC" (descending). Columns are sorted ascending by default. Multiple columns can be separated by commas.
dv.Sort = "CurrencyValue DESC";