I’m trying to get my data in batches, but not sure how to do it. To get it in halves, I was going to take the first half, order by in reverse order and then take first half again. I started off with this:
SELECT TOP 50 PERCENT * FROM Profiles
but I keep getting an error message saying that 'TOP Clause' support not available in SqlCE.. I’ve read some posts that say that it is available but I just keep getting that error (my database is version 3.5). Is there another way to get data back in batches (in this case, halves, but I wouldn’t mind a generic approach) using a query that works in SQLCE 3.5?
Why do you need data in batches? If you’re going to read all of the records anyway, splitting the work into 2 queries won’t help anything. In fact, it may cause more work on the database, as it’ll require the records to be ordered – which may not be necessary otherwise.
Instead, open the Cursor / ResultSet / etc., and scroll through the records. This will be the most efficient in terms of both the application and the database.