I have table called Topic whose structure i am sending with this question.
this topic has columns ParentPKey and Pkey.
and I want to load tree some thing like i have given in the code section
now I want to add all those records in to the tree view who has parentkey =0 as the parent node. then I want to add those nodes whose parentpkey = pkey ( of those nodes whose parentkey = 0).
then I want to those nodes whose parentpkey is equal to the nodes which are added in the second step.
and so on so fourth.
my problem here is there might be a chance that some where in the middle or in the end of records some node come whose parent is on the top of the tree.
right now i am using loops but it totally messed up.
any one could help me here.