private void databind() { string sql = "select * from tgroup where 1=1 "; if (txtGroup.Text != string.Empty) { sql = sql + "and name = '" + txtGroup.Text + "';"; } DataTable dt = GroupManage.Query(sql); this.GroupGrd.DataSource = dt; this.GroupGrd.DataBind(); }