How create Advanced Search?

  • Thread starter Thread starter Bobby Edward
  • Start date Start date
B

Bobby Edward

I am creating an Advanced Search form. The user can select whether their
phrase will search the "Title", "Description" or "All" fields.

Obviously the WHERE clause will change, depending on the options they
select.

Any suggestions on how to implement this? Is the FilterExpression on the
DataSource powerful enough to do this? How have you done similar things?

I am using a 3 tiered architecture.

Thanks!
 
First of all, are you using stored procedures or not? One good way to do
this is to use the SQL keyword LIKE. If you do not want to search the field,
use the value '%' as in the following:

WHERE Title LIKE '%' AND Description LIKE '%' AND All LIKE 'my search
phrase'

If you are using stored procedures, you can use the SQL IF. We may be able
to help you better if we could see your code, including the *.aspx file so
we know how the user will be searching. Good Luck!
 
Nathan Sokalski said:
First of all, are you using stored procedures or not? One good way to do
this is to use the SQL keyword LIKE. If you do not want to search the
field, use the value '%' as in the following:

No. I'm using a BLL class which calls methods in the XSD dataset.
WHERE Title LIKE '%' AND Description LIKE '%' AND All LIKE 'my search
phrase'

Would you use the FilterExpression for this?

Thanks!
 
Back
Top