Recursive VB.net function

D

Do

Hi,

I'm having a small problem with a recursive vb function

The output I'm looking to get is a string that looks like this Folder 1 >
Folder 3 > Folder 5
Folder 5 is a child of 3; and Folder 3 is a child of 1.

They're actually a folder structure put into a database.

FolderID Name ParentID
1 Folder 1 0
2 Folder 2 0
3 Folder 3 1
4 Folder 4 2
5 Folder 5 3
6 Folder 6 4


I know this is a recursive function.
I pull back the data in a datareader and work with it in a loop.
I know somewhere in the loop, I recall the function to append the parent
folder
and continue.

I can't seem to get it to work. I'm going to output to the string and set
it in a label.

Thanks,

Do
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top