Thursday, March 22, 2012

bookmark row position

We have a SqlCeResult set and would like to bookmark or save a row when iterating through it. There is a method for ReadAbsolute, but no "GoToAbsolute". What is the technique or method call to save the row position?

Thanks,

Bryan

I’m not quite sure I understand your issue. What's wrong with ReadAbsolute? What it does not do what mysterious "GoToAbsolute" does?

You have a row number (simply store it in a variable and you've got a bookmark), then do ReadAbsolute(), access the row. Do another ReadAbsolute() with previous row number (store it in another variable) and you’re back.

Naturally you can’t access more than one row at a time as RS is a cursor, it only “points” to one row at a time. If you need to access two (or more) records at the same time use two RS or store row data in memory by calling ResultSet.GetValues().

|||

two questions then... how do you get the row number of the current position?

also, if you have the row number and other rows are added and deleted, then the saved position is not good, right? that's why i was hoping there was a bookmark.

bryan

No comments:

Post a Comment