Database
SQL ServerFiltering Custom Paged Results
The ASP.NET 2.0 data web controls - the GridView, DetailsView, and FormView - all provide built-in paging support that can be enabled at the tick of a checkbox. Unfortunately, this built-in paging support is very inefficient when paging through large amounts of data since it naively grabs all of the records from the data being paged through even though only a subset of the records are displayed. Consequently, when paging through several hundred or thousands of records, it behooves you to implement custom paging. With custom paging, the data Web control hands over its paging responsibilities to us, the page developer. We are tasked with efficiently grabbing the precise subset of records to display and providing this information to the data Web control.
Previous articles here on 4Guys have looked at implementing custom paging in ASP.NET 2.0. In
Custom Paging in ASP.NET 2.0 with SQL Server 2005 we
looked at using a GridView, a Typed
DataSets, an ObjectDataSource control, and
SQL Server 2005's new ROW_NUMBER() keyword
to efficiently page through 50,000 records 10 at a time. Another article, Sorting
Custom Paged Results, looked at a technique for efficiently sorting the custom paged results.
In addition to paging and sorting, another common data request is filtering. When using the inefficient default paging, filtering is easy to implement but includes the same inherent inefficiencies: the data Web control retrieves all of the filtered records even though only a subset of them are displayed on each page. It is possible to implement filtering with custom paging and sorting, however. In this article we will look at extending the custom paging and sorting example - which currently pages and sorts through the 50,000 employees in a fictional company - to include the ability to filter the displayed employees by their department. Read on to learn more!
Before tackling this article make sure you have read and worked through Custom Paging in ASP.NET 2.0 with SQL Server 2005
and Sorting Custom Paged Results...
Read More >
Sponsored Links
Subscribe via RSS
SQL Server
- Naming Database Objects: Part II
- Trace Messages Part V: Trace Cleanup
- Naming Database Objects: Part I
- Multiple-Child Aggregation
- Creating SQL Tables for an Integrating Application Using Dexterity
- SQL Server 2005 Beta 2 Transact-SQL Enhancements
- .NET Rocks! - Brian Larson on SQL Server Reporting Services
- Computing the Trimmed Mean in SQL
- SQL Server 2000 Gains on Oracle
- Separator First Formatting (SFF)
