62,185
社区成员
发帖
与我相关
我的任务
分享
Page_Load(object sender, EventArgs e)
{
l.Text="";
}
<asp:literal runat="server" id="l" />
public string fenye = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
this.BuidGrid();
}
private void BuidGrid()
{ string s2 = "select top "+this.PageItem+" * from fed where serial not in (select top "+PageItem*(CurrentPage-1)+" * from fed )";
SqlCommand comm = new SqlCommand(s2,conn);
conn.Open();
SqlDataReader dr = comm.ExecuteReader(CommandBehavior.CloseConnection);
StringBuilder xt = new StringBuilder();
xt.Append("<table border=0 cellpadding=0 cellspacing=0>");
while (dr.Read())
{
xt.Append("<tr><td>"+dr["serial"].ToString()+"</td></tr>");
}
xt.Append("</table>");
fenye = xt.ToString();
dr.Close();
SqlCommand comm1 = new SqlCommand("select count(*) from fed", conn);
conn.Open();
ToatalCountRecord = Convert.ToInt32(comm1.ExecuteScalar());
conn.Close();
}
<%=fenye %><!--放在你想的位置上-->