JustinG 0 Newbie Poster

Can someone tell me how to store the following information into a dataset. The information is already loaded into the treeview, but I need to figure out how to recurse the tree
and set the values to the specification as laid out. I can't seem to figure that one out. I got this sample from another site, the only code displayed on the site is how to load the info from the db, but not how to store the info.

Layout of the DB

ID ParentID NodeType NodeText
1 null node Introduction
2 null node Management Summary
3 null node Technical Description
4 null node Price Schedules
5 3 node Avaya
6 3 node Brand Rex
7 3 node Panduit
8 5 null 1
9 5 null 2
10 5 null 3
11 5 null 4
12 5 null 5

a pic is here, i dont need to sorttype field
http://photos1.blogger.com/blogger/1390/2194/1600/TreeView1.png

I hope this displays properly when i post it. The null values are
just for display purposes, the fields can stay blank.

This is what I am trying to figure out.

1. The tree already has my nodes, how do I iterate through the entire tree and fill in the ParentID and NodeType for each node?

2. Or possibly how do I recurse the entire tree and assign the values per node as I am saving the info to a DB? I figure this is the best way, because if you drag and drop any nodes the values are going to change. So recursion possibly while saving is the best way to assign the values, I could be wrong.

I don't have a clue on how to do any of that, this is why I am asking. So if anyone can please help me out with this, it will be a great help to me in figuring out this mystery.


Thanks in advance

Justin

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.