A
Andrew Backer
Hope someone can help me with this, since I am stumped.
I need to apply a filter to a dataset so that I can clone those rows,
while keeping the resulting rows in the same natural order as the
original dataset. My code right now is something like this:
// get data, create clone of table struction in newDataSet
for each row as DataRow in table.Select( "name<>'Jimmy'")
newDataSet.Tables(0).ImportRow( row )
next
The results I get out of Select appear to be sorted starting with the
first column, which might be fine sometimes, but this particular
result set is sorted by the 2nd column only, and descending not
ascending.
I don't mind doing something that is a bit slower if It means that the
results will come out in the same order. I need to respect, as much
as possible, the way the stored procedure designer ordered these
things, and if I could dictate all the sorts from code (and it
probably should have been that way to begin with) then I would.
I have workarounds for the specific instances that are causing
problems, but I was hoping for a general solution.
Thanks,
//Andrew Backer
I need to apply a filter to a dataset so that I can clone those rows,
while keeping the resulting rows in the same natural order as the
original dataset. My code right now is something like this:
// get data, create clone of table struction in newDataSet
for each row as DataRow in table.Select( "name<>'Jimmy'")
newDataSet.Tables(0).ImportRow( row )
next
The results I get out of Select appear to be sorted starting with the
first column, which might be fine sometimes, but this particular
result set is sorted by the 2nd column only, and descending not
ascending.
I don't mind doing something that is a bit slower if It means that the
results will come out in the same order. I need to respect, as much
as possible, the way the stored procedure designer ordered these
things, and if I could dictate all the sorts from code (and it
probably should have been that way to begin with) then I would.
I have workarounds for the specific instances that are causing
problems, but I was hoping for a general solution.
Thanks,
//Andrew Backer