Public interface ipage (); DataTable nextpage (); DataTable page (int index);} ///
}
Private DataTable FillPage () {string idstr = this.pageIndexhsh [pageindex] .tostring (); string opc = "select top {0} * from {1} where {2}> = {3}"; opc = string.format (opc, AppGlobalVar.AppRowsPerPage, Orders.TableName, Orders.PrimaryKeyString, idstr); SqlDataAdapter da = new SqlDataAdapter (opc, AppGlobalVar.sqlConn ()); DataSet ds = new DataSet (); da.Fill (ds, "PPC" ); Return DS.Tables ["PPC"];} public datatable firstpage () {this.pageIndex = 0; return this.fillpage ();} public datatable nextpage () {i (this.pageIndex == this.pageIndexhsh. Count-1) this.pageIndex = 0; this.pageIndex ; return this.FillPage ();} public int CurrentPageIndex {get {return this.pageIndex;}} public DataTable Page (int index) {this.pageIndex = index This is not very good: 1: Requires the primary key to perform a relatively small operation 2: No cache can be added to the following features should be improved:
------ Bush each already filled page data; ------ The amount of data is not possible to buffer all accessible data ------ Read the data SQL statement performance is not very good to have a list of recorded access frequencies, only the frequent page data of the cache is not known how to adjust the contradictions ... In addition: If there is a new record, after adding success Directly add new records to the buffer, which can make the record number does not match; in the contradiction. . . . . Which people have a better law, please specify it, thank you first