The list uses the paging method in sqlserver2005.
Setpaginationmodel () { Paginationmodel = New Paginationmodel ();
Paginationmodel. tablename = " ... " ;
Paginationmodel. getfiledsname = " ... " ;
Paginationmodel. ordertype = Sysenumclass. orderby. DESC;
Paginationmodel. orderfiledname = " Sortfield " ;
Paginationmodel. pageindex = 1 ;
Paginationmodel. pagesize = 10 ;
Paginationmodel. wherestring = " ... " ; This. _ paginationmodel = paginationmodel; }
Paginationmodel is a defined object that is used for paging. The aspnetpager control is also used for paging.
Protected Void Aspnetpager1_pagechanged ( Object Sender, eventargs E)
{
This . _ Paginationmodel. pageindex = Aspnetpager1.currentpageindex;
Binddata ()
}
In binddata (), call the paging stored procedure in sqlserver2005 (this can be found online ). If one field is sorted by PAGE and multiple null values exist, pagination becomes invalid (some data appears repeatedly on different pages, but some data does not exist at all ). Therefore, it is best to select a field that does not contain null values for sorting, or to sort multiple fields at the same time (it takes time to sort multiple fields, which may result in performance loss)