By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,731 Members | 1,144 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,731 IT Pros & Developers. It's quick & easy.

Populating a TreeView from a relational database

P: n/a
Let's say I have this db:

Table: Companies
-------
Ford
Toyota
BMW

Table: CarTypes
--------
Sedan
Van
Compact

Table: Colors
------
Red
Blue
Orange
Yellow
Green
Black

Table: Cars
----
ID Color Type Company
-- ----- ---- -------
1 Green Sedan Toyota
2 Red Sedan Toyota
3 Red Van Toyota
4 Blue Van Toyota
5 Blue Sedan Ford
6 Yellow Sedan Ford
7 Yellow Compact Ford
8 Orange Compact Ford
9 Black Sedan BMW

Color, Type and company are foreign keys

I want to represent that in a TreeView
Which will look like this:
Company
|
|-Toyota
| |-Sedan
| | |- Green
| | |- Red
| |-Van
| | |-Red
| | |-Blue
| |
|-Ford
| |-Sedan
| | |-Blue
| | |-Yellow
| |-Compact
| | |
| | |-Yellow
| | |-Orange
| |
|-BMW
| |-Sedan
| |-Black

Any ideas how to implement such thing?
Be as specific as you can

Thanks.

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.