|
-
May 15th, 2003, 11:20 PM
#1
Thread Starter
PowerPoster
[Resolved] Reversing the order of the dataset?
Ok, I have a dataset that is filled from a stored proceedure. The stored proceedure sends back the rows sorted a certain way. What I need to do is use the dataset in its original form, then later on in the code, I need the dataset to be reversed so I can databind it to a datagrid. Any suggestions?
Last edited by hellswraith; May 15th, 2003 at 11:32 PM.
-
May 15th, 2003, 11:32 PM
#2
Thread Starter
PowerPoster
Nevermind, I rediscovered the DataView object and its Sort method. If you looked, thanks...lol.
-
May 15th, 2003, 11:34 PM
#3
Fanatic Member
Why is it important for the rows in the dataset to be in a certain internal order? I mean, if it were really important to get just the result you seem to be asking for I guess you could clone the first dataset, which would copy the schema, and then loop backwards through each table and record and copy the rows from the original to the new dataset... Couldn't you just use a DataView to set the sort order in the datagrid?
edit: bah I post too slow.
-
May 15th, 2003, 11:38 PM
#4
Thread Starter
PowerPoster
Ya, I got it. They had to be in one order (which is what the stored proceedure returned for me), so that was cool. I was just adding some new functionality that required me to resort them to reverse. I could have altered the stored proceedure, but then the first part of the code would be messed up because it required the dataset to be sorted a certain way.
It is cool. I just took the dataview and sorted based on one of the columns using DESC.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|