Jon Davis
Jon Davis

Reputation: 6773

Is there an abstract ADO.NET interface that declares pagination?

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?

Upvotes: 1

Views: 373

Answers (2)

Remus Rusanu
Remus Rusanu

Reputation: 294437

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.

Upvotes: 1

leandrosa81
leandrosa81

Reputation: 138

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.

Upvotes: 1

Related Questions