|
-
Jan 20th, 2003, 05:54 PM
#1
Thread Starter
Fanatic Member
Categories and SQL statement to populate a dropdownlist?
Hi guys.. .this is an interesting problem.. I want to make a database table for a Categories type thing... well, simply put, i want one table, and with that, I can make categories, subcategories, sub sub categories, etc....
lets say i have the follow database:
VB Code:
ID ParentID SubLevel Text
1 0 0 Automotive
2 1 1 Sales
3 2 2 New Cars
4 2 2 Used Cars
5 1 1 Service
6 5 2 Oil Changes
7 5 2 Mufflers
Eventually, i want to fill a dropdown list so it appears like this:
Automotive
Automotive | Sales
Automotive | Sales | New Cars
Automotive | Sales | Used Cars
Automotive | Service | Oil Changes
Automotive | Service | Mufflers
Those should all be items in a dropdownlist... This should be workable somehow with that database structure, i'm just unsure of how to go about a sql query that could fill a dataset with that structure... any ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|