Forums
This topic is locked
Repeating results in my Drop Down List
02 Jul 2006 23:19:41 jon smith posted:
Hello all, just FYI 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?
Replies
Replied 03 Jul 2006 00:46:41
03 Jul 2006 00:46:41 Charles Harford replied:
Try using "SELECT DISTINCT..." in your SQL statement
Charlie
Charlie
Replied 03 Jul 2006 08:53:13
03 Jul 2006 08:53:13 jon smith replied:
Charlie, Thanks alot. I tried it out and it worked. I used the select distinct and instead of returning all just turned the specific column. That really helped me to finish my page I was working on. Thank you once again.
Edited by - soljah on 03 Jul 2006 10:39:49
Edited by - soljah on 03 Jul 2006 10:39:49