public void Query(string sWhere) { GridViewSource_person.DataSQL = _SQL + sWhere; GridViewSource_person.DestControl = gvPerson; GridViewSource_person.PageSize = 10; GridViewSource_person.CurrentPage = 1; GridViewSource_person.DataBind(); }
public void Query(string sWhere) { GridViewSource_person.DataSQL = "select rownum num,t.* from resperson t "; GridViewSource_person.DestControl = gvPerson; GridViewSource_person.PageSize = 10; GridViewSource_person.CurrentPage = 1; GridViewSource_person.DataBind(); }
protected void btnQuery_Click(object sender, EventArgs e) { string sCode = this.txtCode.Text.Trim(); string sName = this.txtName.Text.Trim(); string sWhere = string.Empty; sWhere = string.IsNullOrEmpty(sCode) ? " 1=1 " : string.Format(" t.PERCODE like '%{0}%' ", sCode); sWhere += string.IsNullOrEmpty(sName) ? " and 1=1 " : string.Format(" and t.perNAME like '%{0}%' ", sName); Query(sWhere); GridViewSource_person.GetData(); ClearPersonID(); }
protected void btnQuery_Click(object sender, EventArgs e) { //t.supplierrelationcategoryid='' and t.code='' and t1.orgname like '' string sCode = this.txtCode.Text.Trim(); string sName = this.txtName.Text.Trim(); string sCate = this.dpLstCata.SelectedValue; string sWhere = string.Empty; sWhere += string.IsNullOrEmpty(sCode) ? "" : string.Format(" and t.code like '%{0}%' ", sCode); sWhere += string.IsNullOrEmpty(sName) ? "" : string.Format(" and t1.orgname like '%{0}%' ", sName); sWhere += string.IsNullOrEmpty(sCate) ? "" : string.Format(" and t.supplierrelationcategoryid='{0}' ", sCate); Query(sWhere); GridViewSource_person.GetData(); ClearPersonID(); }