D
Do
Hi,
I have a database table with the following fields: id, name, parentid.
These fields are supposed to create a hierarchy for a list box, an infinite
hierarchy
Child fields of parent fields should be indented.
Root folders have a parentid of zero. Child folders in the hierarchy have
parentids that correspond
to ids. Here are some sample records of folder:
id name parentid
0 Microsoft 0
1 ABC 0
2 Oracle 1
3 Sony 1
4 AOL 3
How do I write a function to loop through this and get me the correct
hierarchy...
I'm at a loss. I loop through a data reader WHERE the parentid = 0
to start. After that, how to I loop as far as I need to return everything
in a hierarchy
something like this
------------------
I have a database table with the following fields: id, name, parentid.
These fields are supposed to create a hierarchy for a list box, an infinite
hierarchy
Child fields of parent fields should be indented.
Root folders have a parentid of zero. Child folders in the hierarchy have
parentids that correspond
to ids. Here are some sample records of folder:
id name parentid
0 Microsoft 0
1 ABC 0
2 Oracle 1
3 Sony 1
4 AOL 3
How do I write a function to loop through this and get me the correct
hierarchy...
I'm at a loss. I loop through a data reader WHERE the parentid = 0
to start. After that, how to I loop as far as I need to return everything
in a hierarchy
something like this
------------------