torisch
Newcomer
Hi!
Have tried to find the answer to this question in the forum, but I have not found what I'm looking for, so I'm posting my problem hoping someone can help me.
I have this table in a MSSql database:
The database can contain Categories(rootcategories), which can again contain an infinite number and levels of subcategories (althoug rearly more than five sublevels..) A rootcategory is indicated by a row in the Category table with catParentID=0, and a subcategory is indicated with a row where catParentID=catID from its parent category.
What I want to do is to reflect the content of this table in the database in a TreeView control in VB.NET.
I think it would be possible to do this with a recursive procedure, but when i try i get into trouble adding the subCategory nodes to the right place in the tree.
Does anyone have any suggestions how to do this an effective way?
--
Regards
Tor Inge
(Pardon my English, it's just my second language...)
Have tried to find the answer to this question in the forum, but I have not found what I'm looking for, so I'm posting my problem hoping someone can help me.
I have this table in a MSSql database:
Code:
Category(catID, catName, catParentID)
The database can contain Categories(rootcategories), which can again contain an infinite number and levels of subcategories (althoug rearly more than five sublevels..) A rootcategory is indicated by a row in the Category table with catParentID=0, and a subcategory is indicated with a row where catParentID=catID from its parent category.
What I want to do is to reflect the content of this table in the database in a TreeView control in VB.NET.
I think it would be possible to do this with a recursive procedure, but when i try i get into trouble adding the subCategory nodes to the right place in the tree.
Does anyone have any suggestions how to do this an effective way?
--
Regards
Tor Inge
(Pardon my English, it's just my second language...)