Is it normal behaviour for a DataReader to return the rows from a query out-of-order?
I'm fetching some rows from a PostgreSQL 8.3.7 database and am using ORDER BY, LIMIT and OFFSET as follows:
SELECT id, name
FROM tbl_foo
ORDER BY name
LIMIT 10 OFFSET 0;
If I run this query manually the results are sorted and then the first ten rows are returned, which is what I would expect.
If I run the same query using a third-party ADO.NET provider for PostgreSQL (http://www.devart.com/dotconnect/postgresql/) the rows are not returned in the same order. It could be an issue with the third-party provider, and I have a post on their forums asking about it.
I've tried loading the rows with DataTable.Fill() and have also looped through them with DataReader.Read(). In either case they aren't coming across in the correct order.
I thought I'd check here as well though and see if anyone has experienced the same behaviour with DataReaders in general.