How create Advanced Search?

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!
 
N

Nathan Sokalski

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!
 
B

Bobby Edward

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,264
Messages
2,571,065
Members
48,770
Latest member
ElysaD

Latest Threads

Top