Mar 11, 2011 at 4:51 AM
Edited Mar 11, 2011 at 4:54 AM
Use DBQuery.SelectTopN() Or Select().TopN() to limit the number of results returned.
As SQLServer does not support the capability to page results (I know SQLite and MySQL do) The limits were not implemented.
Because the only option would have been to throw an exception for SQLServer or manually code a workaround for this engine.
There is the Row_Number() OVER (ORDER BY...) option and I'd be intrigued to see an injection of this in a query for SQLServer and wrap an outer Select statement.
See if you can get close. But at the moment only option is to use the for loop with the data reader.
You may find that NHibernate is also doing this but hiding the details - It's at a much higher level than this library.