From: http://bbs.51js.com/viewthread.php? Tid = 3404
1. Use the built-in paging function of the DataGrid
Add the following statement to the properties of the DataGrid Control:
Allowpaging = "true"
Pagesize = "5"
Pagerstyle-horizontalalign = "right"
Note: allowpaging allows paging. Pagesize indicates the number of records displayed on each page. If not written, 10 records are displayed by default. Pagerstyle-horizontalalign specifies the position of the pagination button. The default value is left.
2. Use SQL statements
Select top @ pagesize * From topic where id not in (select top @ pagesize * @ pagenum ID from topic)
Note: @ pagesize indicates the number of records displayed on each page, and @ pagenum indicates the page number.
In addition, topic is the table name and ID is an identifier column.
3. Use dataset. Fill
Dataset DS = new dataset ();
Sqldataadapter myadapter = new sqldataadapter (strsel, Conn );
Myadapter. Fill (DS, startindex, pagesize, "guest ");
Mydatalist. datasource = Ds. Tables ["guest"]. defaultview;
Note: startindex refers to the number of records read, and pagesize refers to the number of records to read. 4. Use datatable. Rows
For I = nstart to nend
Response. Write (Dt. Rows (I) ("itemname") & "<br> ")
Next
Note: nstart indicates the sequence number of the record to be read, and nend indicates the sequence number of the last read record.
DT is a datatable object.
Additional help documentation (basically all downloaded from 51js (carefree script), good)
/Files/dotnetdoor/css2.zip
/Files/dotnetdoor/DOM2-Core.zip
/Files/dotnetdoor/html40.zip
/Files/dotnetdoor/websites_color.rar
/Files/dotnetdoor/xmlhttp.rar
/Files/dotnetdoor/chm.rar
/Files/dotnetdoor/designpatten.rar
/Files/dotnetdoor/iewebcontrols.rar
/Files/dotnetdoor/jsdoc.rar
/Files/dotnetdoor/thinkinjava.rar