private void GetSale() { DataTable dt = tmo_order.GetSaleCode(txtcustname.Text, txtconno.Text, txtyewuyuan.Text, Start.Value, End.Value).Tables[0]; PagedDataSource ps = new PagedDataSource(); ps.DataSource = dt.DefaultView; Pager1.RecordCount = ps.Count; if (Pager1.RecordCount > 0) { ps.AllowPaging = true; ps.PageSize = Pager1.PageSize; ps.CurrentPageIndex = Pager1.CurrentPageIndex - 1; rptSale.DataSource = ps; rptSale.DataBind(); } else { rptSale.DataSource = null; rptSale.DataBind(); } }