日期:2014-05-17 浏览次数:20432 次
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bind();
}
}
protected void bind()
{
String Zl = Request.QueryString["zlname"].ToString();
string sqlstr = "select * from y_newnr inner join (select * from y_newlm )as a on a.lmid=y_newnr.lmid where zlname='" + Zl + "'";
OleDbConnection conn = new OleDbConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
PagedDataSource ps = new PagedDataSource();
OleDbDataAdapter da = new OleDbDataAdapter(sqlstr, conn);
DataSet ds = new DataSet();
da.Fill(ds, "y_newnr");
ps.DataSource = ds.Tables["y_newnr"].DefaultView;
AspNetPager1.RecordCount = ps.Count;
ps.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
ps.AllowPaging = true;
ps.PageSize = AspNetPager1.PageSize;
GridView1.DataSource = ps;
GridView1.DataBind();
}
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{
bind();
}