Response.Write("<font color=\"#999999\">"); Response.Write("( "+dr["SummaryDateTime"].ToString()+" )"); Response.Write(" ( 已阅读"+dr["ReadTimes"].ToString()+"次 )"); Response.Write("</font>"); Response.Write("</td>");
Response.Write("</tr>"); } Response.Write("</p>"); startID = ds.Tables["Table"].Rows[0].ItemArray[0].ToString(); //通过数组,取第一个数据,得到开始号“startID” RowCount = ds.Tables["Table"].DefaultView.Count;//得到表的行数 endID = ds.Tables["Table"].Rows[RowCount-1].ItemArray[0].ToString();//通过数组,取最后一个数据,得到结束号“endID” } catch(SqlException e) { Response.Write(e.Message); } }
/// <summary> /// 计算未显示记录数 /// </summary> /// <returns></returns> protected void NotShownRecords() { not_shown_records = this.CountRecord()/*查询总记录数*/ - (CurrentPage/*当前页*/ - 1) * page_count/*每页记录数*/; }
/// <summary> /// 进行输出信息 /// </summary> protected void PageLoad_Count() { this.NotShownRecords(); Response.Write("总共"+this.CountRecord()+"条记录 "); Response.Write("共有"+this.Page_Count()+"页 "); Response.Write("第"+CurrentPage.ToString()+"页 "); Response.Write("本页共有"+RowCount.ToString()+"条记录 "); }
/// <summary>
上一篇:小偷程序(ASP.NET+c#)
下一篇:Asp.net如何连接SQL Server2000数据库
|