Use DataView DataView DV = New DataView (DATATABLE); DV.SORTING = "Sort by column name"; // Sort by ASC | DESC -------------------------------------------------------------------------------------------------------- ---------------------------------------- DataView DV = DATATABLE1.DEFAULTVIEW; DV.SORT = "ID ASC"; -------------------------------------------- ---------------- // If the Dataset has been taken, then your requirements cannot be achieved. //1. This method can also be used to filter DATAROW // 2 using a DataTable SELECT. Add the sequence of DataRow to DataTable
String strexpr = ""; string strsort = "column desc"; DATAROW [] DR = DS1.TABLES [0] .Select (STREXPR, STRSORT); DS1.TABLES [0] .clear (); Foreach (DataRow Next In DR) ) {DS1.TABLES [0] .Rows.Add (next);
// Datun me!