用Repeater做分页遇到点困难 ===数据库控制分页====
我想用数据库的SQL 控制分页功能 要求每页显示4条记录,
可是我不知道怎么写啊
请大侠们帮帮忙 解决怎么分页。
protected void lbtnfirstpage_Click(object sender, EventArgs e)
{
LinkButton lb = (LinkButton)sender;
switch (lb.ID.ToString())
{
case "next ":
SqlConnection conn = new SqlConnection( "server=localhost;database=Templit;uid=sa;pwd= '4321 ' ");
str = @ "select top 4 * from message where id not in ( select top 5 id from message order by id desc) order by id asc ";
conn.Open();
SqlDataAdapter da = new SqlDataAdapter(str, conn);
DataSet ds = new DataSet();
da.Fill(ds, "table ");
Repeater1.DataSource = ds.Tables[ "table "].DefaultView;
Repeater1.DataBind();
conn.Close();
break;
case "first ":
conn = new SqlConnection( "s