Hello,
I need help with "Advanced Search". I've seen other applications having a form that user can build queries from comboboxes choosing its own criteria and show them as reports.
For example in the first combobox they choose Table, then field,then criteria.
Is there any examples or explanation of how these works?
Thank you in advance.
Loading
Jisss shyamPosted Oct 21, 2009, 5:59 AM
you can create sql statements like this
string sql = "SELECT * FROM " + comoTable.Text + " WHERE " + comboField.Text + " " + comboCriteria.Text + " " + comboCritParam.Text + "";
you can change statement according to comboboxes and other controls
thanks
theLizardPosted Oct 23, 2009, 4:15 AM
You should also consider using check boxes for selecting > < = != because you could have more than one selection criteria in the WHERE clause ie name <= 'smith' OR name >= 'thomas' OR name != 'thompson' AND country = 'mycountry'
You may also want to use conditionals to create your sql statement ie, you would have a check box to include an ORDER BY part or GROUP BY.
DealyPosted Oct 23, 2009, 3:54 AM
DealyPosted Oct 13, 2009, 2:36 AM
With the above user will create its own queries dynamically.
nitin murkutePosted Oct 6, 2009, 6:21 AM