Search Functionality Dilemma

  • Thread starter Thread starter Nightcrawler
  • Start date Start date
N

Nightcrawler

I need some input as to how the cleanest way to code the following. I
have a aspx search page with a datalist displaying the results. Above
the datalist are 2 textboxes and 2 dropdownlists.

The idea is that the end user can choose any combination of the 2
textboxes and 2 dropdownlists to narrow down the search critera.

Should I write one stored procedure for each of the possible
combinations (16 combinations) and call them depending on what the
user selects? Should I write a massive stored procedure with 16
combinations?

There must be a leaner way of doing this?

Any help is highly appreciated.

Thanks
 
Ysgrifennodd Nightcrawler:
I need some input as to how the cleanest way to code the following. I
have a aspx search page with a datalist displaying the results. Above
the datalist are 2 textboxes and 2 dropdownlists.

The idea is that the end user can choose any combination of the 2
textboxes and 2 dropdownlists to narrow down the search critera.

Should I write one stored procedure for each of the possible
combinations (16 combinations) and call them depending on what the
user selects? Should I write a massive stored procedure with 16
combinations?

There must be a leaner way of doing this?

Any help is highly appreciated.

Thanks

Can't you pass in parameters, into your stored procedure?


Peter
 
Why would you need to do that? Clearly, each of the textboxes can only
have one value, so you would only need four parameters for your stored
procedure. Your stored procedure would then execute a query based on the
parameters.
 

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

Back
Top