I'm adding an auto increment column (called "rowNum") to my table and it's working good, after that I use this code to sort datatable rows :
DataView dv = MyDataSet.Tables[0].DefaultView;
dv.Sort = "columnName DESC";
where columnName is one of my columns (not the auto increment one).
Now,The problem is: when I want to get the top 10 rows I use this code :
dv.RowFilter = "rowNum <= 10";
The result is not what I want, because when I do dv.Sort
the rowNum shuffled (becomes in wrong order).
How can I get top 10 rows after sorting rows?