Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Multiple (unrelated) declarative parameters

Reply
Thread Tools

Multiple (unrelated) declarative parameters

 
 
Tastic
Guest
Posts: n/a
 
      02-16-2007
Hi, I am working on a search & filter form using about 6 different
dropdown boxes, and possibly more to come.

Here is what I am trying to acheive; if the user does not specfiy any
choice in a ddb then then that particular filter is not applied... I
am probably not making a lot of sense here...

dd1 = Business Type (accountant/lawyer/restaurant etc)
dd2 = Business Category (Service / Price / Product Quality etc) ie
what is more important to the user
dd3 = product type(for accountant this would be type of accountant,
for a restaurant it would be type of cuisine)
dd4 = suburb
dd5 = City
dd 6 = Country

in order to select suburb the user will need to first select City,and
in turn first select country
this part is fine, I know how to set this up

but if the usr only selects values from say dd1 and dd3 and dd6 then
the other parameters should be removed but leave the ability for the
usr to then turn around and filter more

I have done this with one ddb through objectdatasource the DAL has two
select queries one with the parameter and one with out. The BLL simply
states if parameter >0 call (select without)
else call (select with)
My actual question: am I going to have to sit here and manually go
through every possible combination of parameters used? (this would be
exceptionally time consuming not to mention messy)

or is there something I can do in my BLL to add or remove parameters
depending on selections

 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      02-16-2007
"Tastic" <> wrote in message
news: ups.com...
> Hi, I am working on a search & filter form using about 6 different
> dropdown boxes, and possibly more to come.
>
> Here is what I am trying to acheive; if the user does not specfiy any
> choice in a ddb then then that particular filter is not applied

....
> My actual question: am I going to have to sit here and manually go
> through every possible combination of parameters used? (this would be
> exceptionally time consuming not to mention messy)
>
> or is there something I can do in my BLL to add or remove parameters
> depending on selections


What if your query was something like this:

SELECT * FROM MY_TABLE
WHERE (
((@DDL1_PRESENT AND DDL1 = @DDL1) OR (NOT @DDL1_PRESENT)) AND
((@DDL2_PRESENT AND DDL2 = @DDL2) OR (NOT @DDL2_PRESENT)) AND ...
)

Then your only trick would be to supply the *_PRESENT parameters by testing
to see if ddl's have the "Please Select" item selected.

John


 
Reply With Quote
 
 
 
 
Tastic
Guest
Posts: n/a
 
      02-16-2007
On Feb 17, 10:13 am, "John Saunders" <john.saunders at trizetto.com>
wrote:
> "Tastic" <brett.sm...@ihug.co.nz> wrote in message
>
> news: ups.com...
>
> > Hi, I am working on a search & filter form using about 6 different
> > dropdown boxes, and possibly more to come.

>
> > Here is what I am trying to acheive; if the user does not specfiy any
> > choice in a ddb then then that particular filter is not applied

> ...
> > My actual question: am I going to have to sit here and manually go
> > through every possible combination of parameters used? (this would be
> > exceptionally time consuming not to mention messy)

>
> > or is there something I can do in my BLL to add or remove parameters
> > depending on selections

>
> What if your query was something like this:
>
> SELECT * FROM MY_TABLE
> WHERE (
> ((@DDL1_PRESENT AND DDL1 = @DDL1) OR (NOT @DDL1_PRESENT)) AND
> ((@DDL2_PRESENT AND DDL2 = @DDL2) OR (NOT @DDL2_PRESENT)) AND ...
> )
>
> Then your only trick would be to supply the *_PRESENT parameters by testing
> to see if ddl's have the "Please Select" item selected.
>
> John


Thanks very much I'll see how it goes

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Proper way to use LIKE operator with SqlDataSource and control parameters in declarative markup? ASP .Net 2 08-18-2007 02:07 AM
Interdependent DropDownLists (with declarative data binding) =?Utf-8?B?VGltbQ==?= ASP .Net 11 06-29-2006 06:49 AM
Help Pls - declarative data binding =?Utf-8?B?QmlsbDQ0MDc3?= ASP .Net 4 01-27-2006 07:50 PM
declarative binding inside a gridview John ASP .Net 0 12-13-2005 06:36 PM
Declarative Security in ASP .net MS Newsgroups ASP .Net 1 10-19-2003 07:21 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57