绑定数据

protected void databind()
    {
        string sqlstr = "";
        SqlParameter[] par = new SqlParameter[]
        {
         
        };
        PagedDataSource pds = new PagedDataSource();
        pds.DataSource=dbhelp.GetDataSet(sqlstr,par).DefaultView;
        this.AspNetPager1.RecordCount=pds.Count;
        pds.AllowPaging = true;
        pds.PageSize = this.AspNetPager1.PageSize;
        pds.CurrentPageIndex = this.AspNetPager1.CurrentPageIndex - 1;
        this.GridView1.DataSource= pds;
        this.GridView1.DataBind();
    }

posted @ 2012-10-10 10:48  树形图  阅读(143)  评论(0编辑  收藏  举报