Hi.

I have a 3 tier application (gui, business and data connecting to an sql server database)

My problem is this... I need to populate a treeview for a certain criteria (Department & Section).

How would i go about this? I would pass the Department & Section to the business layer which would then run a query in the data layer. The function(s) i assume would have to be recursive because i dont know how many sub items of one item there will be, how would i then pass the tree structure back to the GUI and populate the treeview????

Does that make any sense??

Example DB Layout:

ID Name Owner Department Section
-----------------------------------------------------------------------
1 Root Folder 1 0 A Dep A Sec
2 Sub Folder 1 1 A Dep A Sec
3 Sub Folder 2 1 A Dep A Sec
4 Sub Folder 3 3 A Dep A Sec

etc... etc....

Thanks in advance.