Hi Paez,
If you need to sort the DataRows just to display them on a DataGridView via
binding, for example, then just bind to a DataView instead and set the Sort
property. It's much easier and certainly more practical then reordering the
actual DataRows within the DataTable.
// dataTable is an instance of your DataTable
dataTable.DefaultView.Sort = "FirstName DESC";
dataGridView.DataSource = dataTable.DefaultView;
DataView Class
http://msdn2.microsoft.com/en-us/lib....dataview.aspx
You'll need a column to sort on, of course. If you simply need to reverse
the records as they exist in the DataTable then add a new AutoNumber column
to the DataTable and sort by that column.
Data Access in Client and Middle-Tier Programming
How to: Create an Autonumber DataColumn
http://msdn2.microsoft.com/en-gb/lib...4b(VS.80).aspx
--
Dave Sexton
http://davesexton.com/blog
"Paez" <marco.pais@[IGNORE]gmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hi there.
Anybody knows if is it possible to reverse a dataset? Lets say, if the
dataSet has 10 rows, row 1 will row 10 and row 10 will be 1 and so on...
Thanks in advance.
Paez