DataTable videotable = _ds.Tables[0];
int count = videotable.Rows.Count;
for (int i =0; i <int.Parse(psize) - count; i++)
{
DataRow videorow = videotable.NewRow();
videotable.Rows.InsertAt(videorow, videotable.Rows.Count);
}
GridView1.DataSource = videotable;
GridView1.DataBind();
private DataSet getData(string pagesize, string pageindex ) { string where = sqlWhere; if (this.hid_where.Value.Length > 12 && sqlWhere == "") { where += DEncrypt.Decrypt(hid_where.Value); } else {
}
strSQL = new StringBuilder(); strSQL.Append("select top "); strSQL.Append(pagesize); strSQL.Append(" 字段1,字段1,字段1,字段1,字段1 from news where 1 = 1 "); strSQL.Append(where); if (pageindex == "1") { strSQL.Append(" order by LastTime desc"); } else { strSQL.Append("and NewsID not in(select top "); int pindex = int.Parse(pageindex); pindex = (pindex - 1) * int.Parse(psize); strSQL.Append(pindex.ToString()); strSQL.Append(" 字段1 from news order by LastTime desc) order by LastTime desc"); }
this.hid_where.Value = DEncrypt.Encrypt(where);
dbhelp = new DbHelperSQLP(); return dbhelp.Query(strSQL.ToString()); }