td> tr> table> < / center> div>
4, the HTML code generates a three-line form, dragging the control from the toolbox to the third line of the table.
5. Add the following code in the Private Void Page_Load (Object Sender, System.EventArgs E) Event Handle: int CP;
IF (this.Request.Params ["CurrentPage"] == null) {
CP = 1;
}
Else
{
CP = Convert.Toint32 (this.Request.Params ["currentpage"]);
}
SqlConnection Con = New SqlConnection ("Server = Accp-lzh; UID = SA; PWD = Sasa; Database = Northwind");
SQLCommand cmd = new SQLCOMMAND ("Select * from [Order Details]", CON;
SqldataAdapter adapter = new sqldataadapter ();
Adapter.selectCommand = CMD;
DataSet DS = New DataSet ();
C.Open ();
Adapter.Fill (DS, "Table");
C. close ();
DataTable DT = New DataTable ();
DT = DS.TABLES ["Table"];
// The following setup control parameters
this.lzhpages1.allcount = dt.rows.count; / / total record
This.lzhpages1.currentpage = cp; // Current page, read from the URL
this.lzhpages1.showpages = 10; // Navigator Number
this.lzhpages1.count = 10; / / The number of records displayed per page
StringBuilder SQL = New StringBuilder ();
// The following three strings are finally combined into a complete form
String htmlheader = ""; // tag
String htmlbody = ""; // There are several tags in the middle, ie
String htmlfoot = ""; // table> tag
Sql.appendformat ("Select Top {0} * from [Order Details] Where 1 = 1 and ORDERID NOT IN (SELECT TOP {1} Orderid from [Order Details] Where 1 = 1 Order by OrderID Desc) Order by OrderID DESC" , this.lzhpages1.count, this.lzhpages1.currentpage * this.lzhpages1.count;
SQLCommand cmd1 = new sqlcommand (sql.tostring (), con);
Adapter.selectCommand = cmd1;
C.Open ();
Adapter.Fill (DS, "Table1");
C. close ();
DT = DS.TABLES ["Table1"];
htmlHeader = " / n "; for (int i = 0; i
{
HTMLBODY = HTMLBODY STRING.FORMAT (" / n {1} td> / n | {2} td> | | |