Ahhh! Great idea, Dean! 
 
The Key values are not sequential but option 2 will definitely work! I'll give 
it a try and see if it turns out to be faster than walking the table. 
 
Thanks! 
 
-Matias

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf 
Of Dean Fiala
Sent: Sunday, May 22, 2005 11:26 PM
To: [email protected]
Subject: Re: [AspNetAnyQuestionIsOk] ADO.NET: Finding the NEXT row with 
dt.rows.Find()


Without any other information in your table or a supporting structure,
you will need to do it the hard way -- loop through.

However, you can do one of two things:

1) Include a column that holds a sequential  you build your table. 
Then you can use the find method, get the sequential ID value and then
do a find again on the sequential ID column for sequential ID + 1.

Or

2) you could load the keys for the rows into an ArrayList, get the
index of the key to the first row in the ArrayList using IndexOf. The
value in the next item in the ArrayList is the key of the row you want
and you would use that in the Rows.Find to retrieve the record.


On 5/22/05, Mat�as Ni�o ListMail <[EMAIL PROTECTED]> wrote:
> Hey y'all,
> 
> I'm having trouble determining what method to use to find the row AFTER a 
> certain row in a datatable.
> 
> All I have is they key value and I want to use dt.rows.Find(key), but the 
> value I need is located in the next sequencial row.
> 
> Should I just walk the table for the key and get the dt.rows(i+1) when the 
> key is found? I just figured rows.find(key) would be faster.
> 
> BACKGROUND:
> My web page displays a table of rows of performances of a single song. For 
> each of those rows, I want to look up what song was played after it in a 
> larger table of all song performaces.
> 
> Thanks for any input,
> Matias
> Manassas, VA
> 
> 
> [Non-text portions of this message have been removed]
> 
> 
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 


-- 
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com


________________________________

Yahoo! Groups Links


*       To visit your group on the web, go to:
        http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
          
*       To unsubscribe from this group, send an email to:
        [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
          
*       Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service 
<http://docs.yahoo.com/info/terms/> . 




[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to