I've got a datatable that I need to sort and place back into another datatable. On the face of this its easy as below:
DataTable sortme = getdata();
sortme.Select("col1 = 'something'", "sortbyme ASC").CopytoDataTable();
However, I've found as soon as I pass the DataRow array created by select() to CopytoDataTable(), the new datatable is no longer sorted by sortbyme
.
How do I fix this without creating a loop to push each DataRow into a datatable? And what is causing the sorting to be lost?