public void DataBindToGridview() { ZWL.BLL.ERPYinZhangLog MyRiZhi = new ZWL.BLL.ERPYinZhangLog(); GVData.DataSource = MyRiZhi.GetList("UserName like '%" + this.TextBox2.Text.Trim() + "%' and DoSomething like '%" + this.TextBox1.Text.Trim() + "%' and TypeStr='" + Request.QueryString["Type"].ToString() + "' order by ID desc"); GVData.DataBind(); LabPageSum.Text = Convert.ToString(GVData.PageCount); LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1)); this.GoPage.Text = LabCurrentPage.Text.ToString(); }
public void DataBindToGridview() { GVData.PageSize = AspNetPager1.PageSize; GVData.PageIndex = AspNetPager1.CurrentPageIndex - 1; ZWL.BLL.ERPYinZhangLog MyRiZhi = new ZWL.BLL.ERPYinZhangLog(); DataSet ds = MyRiZhi.GetList("UserName like '%" + this.TextBox2.Text.Trim() + "%' and DoSomething like '%" + this.TextBox1.Text.Trim() + "%' and TypeStr='" + Request.QueryString["Type"].ToString() + "' order by ID desc"); GVData.DataSource = ds; GVData.DataBind(); AspNetPager1.RecordCount = ds.Tables[0].Rows.Count; }