所有搜索的一般查询 [英] General Query for all Searching
本文介绍了所有搜索的一般查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我放置的表格上
1. Combobox(用于列名)
2.用于搜索Criterai的Combobox(例如,like,=,not equal,In, <,>)
3.文本框(特定单词或短语搜索)
4. Combobox For和or OR运算符
5 。按钮:事件将再次产生1,2,3,4以上
现在我想用上面的东西做一个搜索表单。我想对所有人进行一般查询。
用户可以
( 1)用户选择任何列名
然后(2)选择他的搜索标准
然后(2)键入短语或单词
然后(3)选择运算符
如果用户想要更多然后单击按钮并再次添加1,2,3,4组控件再次填写他的要求。
推荐答案
你是是的。但是我陷入了困境。如何开始。我是否需要为组合框的价值制定每个条件?
如何开始是创建一个UserControl来处理它 - 这使您的表单代码更容易,因为您只需在用户添加另一个组时添加一个控件。我将转换组合框用于AND / OR并用两个按钮(在UserControl外部)替换它,它取代单个按钮以添加一个新组。
在 group你只需要在构造它时输入列名,并提供一个查询方法来读出用户选择的内容。
这样做有意义吗?
"You are right. But i am stuck in the Beginning . how to start. Do i need to make each condition for combobox value?"
How I would start is to create a UserControl to handle it all - this makes your form code easier as you only have to add a single control when your user adds another "group". I would dump the combobox for AND / OR and replace it with two buttons (outside the UserControl) which replace the single button to add a new group.
Within the "group" you then just need to feed in the column names when you construct it and provide a "query" method to read out what the user has selected.
Does that make sense?
这篇关于所有搜索的一般查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文