0
我正在編寫一個鉤入Access數據庫的程序。我有3個搜索條件,我試圖結合。其中兩個過濾器來自複選框,而第三個是搜索框。單獨這三個工作很好。但是,嘗試連接過濾器時,它似乎只識別'CheckedSListFilter'。我已經測試了串聯字符串的多次迭代,沒有任何運氣。我希望這只是一個語法問題。謝謝你的幫助。BindingSource.Filter:組合多個篩選器C#Winforms
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+")";