Drop Down List identical items

Author Topic
Jon Smith
Member

Joined: 30 Jun 2006
Country:
Posts: 1

Posted: 03 Jul 2006 08:51:21

Hello DN zone, just I'm using asp.net 1.1 VB with Dreamweaver 8 and SQL 2000. I have items with mutiple galleries. For the table with the item gallery information on the database I have these as columns, id, item code, image name, and gallery catagory.
Each item has multiple images and multiple gallery catagories that are specific to that item. I use a drop down list to select the item gallery catagory and all teh images associated with that gallery show. The drop down list uses a dreamwear dataset with parameter query. The parameter is the item code, and the text of the drop down list is the gallery catagory.
Everything works great except that in my drop down list the results are equal to every image with that item id and repeat item catagory.
Exmaple Item code= "mufflers" and for this item code there are 3 gallery catagories "Corsa" , "Flowmaster", and "Borla". Each of these catagories have 3 images each of a total of nine images in for the item code.
I have everything working properly except my Drop Down List to select the categories is repeating the categories for every image. So instead of the drop down list showing only the three catagories:
“Corsa
Flowmaster
Borla”
the Drop Down List shows:
“Corsa
Flowmaster
Borla
Corsa
Flowmaster
Borla
Corsa
Flowmaster
Borla”
because in total there are 9 images. The drop down list has to be dynamic as is because another Item code will have different categories. For Example the second item code may be “Tires” and the categories for it will be “Goodyear”, “Dunlop”, and “Michelin”.
So everything in the application and page works great except the repeating of categories in the drop down list, any suggestions on how to solve this?

Hello DN zone, just I'm using asp.net 1.1 VB with Dreamweaver 8 and SQL 2000. I have items with mutiple galleries. For the table with the item gallery information on the database I have these as columns, id, item code, image name, and gallery catagory.
Each item has multiple images and multiple gallery catagories that are specific to that item. I use a drop down list to select the item gallery catagory and all teh images associated with that gallery show. The drop down list uses a dreamwear dataset with parameter query. The parameter is the item code, and the text of the drop down list is the gallery catagory.
Everything works great except that in my drop down list the results are equal to every image with that item id and repeat item catagory.
Exmaple Item code= "mufflers" and for this item code there are 3 gallery catagories "Corsa" , "Flowmaster", and "Borla". Each of these catagories have 3 images each of a total of nine images in for the item code.
I have everything working properly except my Drop Down List to select the categories is repeating the categories for every image. So instead of the drop down list showing only the three catagories:
“Corsa
Flowmaster
Borla”
the Drop Down List shows:
“Corsa
Flowmaster
Borla
Corsa
Flowmaster
Borla
Corsa
Flowmaster
Borla”
because in total there are 9 images. The drop down list has to be dynamic as is because another Item code will have different categories. For Example the second item code may be “Tires” and the categories for it will be “Goodyear”, “Dunlop”, and “Michelin”.
So everything in the application and page works great except the repeating of categories in the drop down list, any suggestions on how to solve this?
Tim Barnett
Member

Joined: 11 Jul 2006
Homepage: link
Country: New Zealand
Posts: 1

Posted: 21 Aug 2006 00:52:32

At the moment your SQL statement is probably just <b>SELECT <i>field</i> FROM <i> table</i></b>
Change your SQL statement to <b>SELECT DISTINCT (field) FROM <i>table</i></b>
By Selecting UNIQUE you don't get duplicates

Edited by - timb_nz on 21 Aug 2006 00:53:12

Edited by - timb_nz on 21 Aug 2006 07:58:32

At the moment your SQL statement is probably just <b>SELECT <i>field</i> FROM <i> table</i></b>
Change your SQL statement to <b>SELECT DISTINCT (field) FROM <i>table</i></b>
By Selecting UNIQUE you don't get duplicates

Edited by - timb_nz on 21 Aug 2006 00:53:12

Edited by - timb_nz on 21 Aug 2006 07:58:32
Follow us on twitter Subscribe to our RSS feed
Activate your free membership today | Login | Currency