Exemplo n.º 1
0
    /// <summary>
    /// ��Grid
    /// </summary>
    protected void BindGrid()
    {
        PRoleBB roleBB = new PRoleBB();
        DataSet ds = new DataSet();

        try
        {
            string strWhere = "";

            strWhere = this.StrWhere;

            if (this.txtRoleName.Text.Trim() != "")
            {
                strWhere += " and roleName like '%" + this.txtRoleName.Text.Trim() + "%'";
            }

            ds = roleBB.GetVList(strWhere);

            this.grid.DataSource = ds.Tables[0];
            this.grid.DataBind();

            //��ֵ��¼������ҳ������
            this.Label3.Text = ds.Tables[0].Rows.Count.ToString();
            this.Label2.Text = this.grid.PageCount.ToString();
            this.currPage.Text = (this.grid.PageIndex + 1).ToString();
        }
        finally
        {
            roleBB.Dispose();
        }
    }