Navigating a Record Set

Navigating a Record Set

Post by Asela Guna » Thu, 05 May 2005 13:27:45


Hi.

I need to navigate a dataset bottom-up. or in other words what a normal
foreach statement navigates the rows in a particular table from the fist
record to the last but my requirement is to navigate the rows the other way
around [from the last record to the first]. can somebody help me on this.

thankx
-asela
 
 
 

Navigating a Record Set

Post by Jim Hughe » Thu, 05 May 2005 13:52:35

for dt.rows.count -1 to i as integer = 0 Step -1
'do processing here
next

 
 
 

Navigating a Record Set

Post by Asela Guna » Thu, 05 May 2005 15:21:17

Actually i want to do this with C#; so what i would like to know is how to
traverse the rows collection inside a <for loop> or any other loop for that
matter cos though we can successfully run through the loop it dosenot moveto
the next record while doing so.





this.
 
 
 

Navigating a Record Set

Post by Rick Elber » Mon, 09 May 2005 21:56:06

Asela,

Sort the records the other way around ?
Use a currencymanager go to the Count-1 record and move Position back
to 0 ?

Rick



On Wed, 4 May 2005 10:27:45 +0600, "Asela Gunawardena"