Hello.
I'm basically asking...what is a good way to do this...
I have a database table called folders....that has these fields.
ID(int, Primary Key, seeded) Title(varchar) Parent_Folder_ID(int)
I have about 400 records in this table. If the Parent_Folder_ID field is null, that means that the folder is a top level folder, or root folder. An example would be..
RECORDS
ID TITLE PARENT_FOLDER_ID
1 Wisconsin NULL
2 Madison 1
3 Milwaukee 1
4 Communities 2
So I have all these records...and I want to make them into a tree view..that would look like this.
-Wisconsin
-Madison
Communities
Milwaukee
That shows the hierarchy of the folders. I can do this fine...but right now I must be doing it a terrible way because it takes about 3 minutes to excute all the database querys i'm doing. (I first grab the folder, then grab all child folders of it...) so i'm running like a million database queries.
Is there an easy way to do this...? I thought maybe c# had some of those collections that would help me out in this case...(I've never really used them so didn't know which one would be best for this scenerio)
Thanks,
ArchG