public void BindData() { DataSet ds = new DataSet(); StringBuilder strWhere = new StringBuilder(); strWhere.Append(" 1=1 "); if (txtKeyword.Text.Trim() != "") { strWhere.AppendFormat(" and title like '%{0}%' ", txtKeyword.Text.Trim()); } ds = bll.GetList(strWhere.ToString()); Common.CommonHelper.AddDtColumns(ds.Tables[0], "types", ClassHelper.Ad_Type_Arr); gridView.DataSource = ds; gridView.DataBind(); }