【发布时间】:2014-06-23 07:42:54
【问题描述】:
我正在编写一个连接到 Access 数据库的程序。我有 3 个我正在尝试组合的搜索条件。其中两个过滤器来自复选框,而第三个是搜索框。这三个单独工作很好。但是,当尝试连接过滤器时,它似乎只能识别“CheckedSListFilter”。我已经测试了连接字符串的多次迭代,没有任何运气。我希望这只是一个语法问题。谢谢你的帮助。
string SFilter = CheckedSListFilter();// method returns string "S = 'w1' OR S = 'w2' OR S = 'w3'"
string PFilter = CheckedPStatusFilter();//method returns string "PA = 'True' OR "PB = 'True'"
string CFilter = comboBox_SearchFields.Text;
string filter = CFilter + " LIKE '" + "*" + textBox_search.Text + "*" + "'";//returns "R LIKE '*g*'"
BindingSource bs = this.projectBindingSource;
bs.Filter = filter+" AND "+"("+PFilter +" OR "+SFilter+")";
【问题讨论】:
标签: c# winforms ms-access-2010 bindingsource