views:

117

answers:

2

I'm implementing a DAL library that is database vendor neutral. Is there an abstraction in ADO.NET (System.Data) for describing pagination? And, do some vendors' ADO.NET provider implementations support such an interface so that I don't have to manually tool up the customized SQL syntax?

+1  A: 

Paging is very platform-specific, because it requires you to retrieve the correct 'page' of data from the database.

Unfortunately, I don't think there is any SQL standard for retrieving those pages.

leandrosa81
No I know there's no ANSI SQL standard for it because I know that each provider implements it differently at the SQL level. I was looking for ADO.NET abstraction, whether implemented or not.
stimpy77
+1  A: 

ADO.Net has no support for pagination. LINQ2SQL has, because the Skip and Take operators are implemented by the SQL provider using the ROW_NUMBER() functions. Entity Framework supports SKIP and LIMIT in its Entity-SQL syntax and also the LINQ operators for Linq2EF, see How to: Page Through Query Results (Entity Framework).

The LINQ2SQL methods are specific to SQL Server, however the EF methods are 'generic', as long as you're willing to use EF instead of the old ADO.Net methods.

Remus Rusanu