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:
  1. ID                   ParentID                   SubLevel                   Text
  2. 1                     0                               0                            Automotive
  3. 2                     1                               1                            Sales
  4. 3                     2                               2                            New Cars
  5. 4                     2                               2                            Used Cars
  6. 5                     1                               1                            Service
  7. 6                     5                               2                            Oil Changes
  8. 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?