create tree/XML structure from SQL query c#
Posted
by
Tim Bassett
on Stack Overflow
See other posts from Stack Overflow
or by Tim Bassett
Published on 2012-10-15T15:22:17Z
Indexed on
2012/10/15
15:37 UTC
Read the original article
Hit count: 163
Here is my current issue. I need to display a tree like structure displaying a recall roster. Our DBA created a stored procedure that returns [level],[name],[contact_info].
Example looks like:
[1] [test name1] [contact info]
[2] [sub to1] [contact info]
[3] [sub to2] [contact info]
[4] [sub to3] [contact info]
[3] [sub to2] [contact info]
[2] [sub to1] [contact info]
etc...
It's sorted in the order of the hierarchy
I haven't really worked with XML much but is that the way to go in loading/presenting this data. Currently when I retrieving the data I'm returning it in a datatable. There may also be a need to export this data to Excel.
Can anyone point me a good direction to go with this?
© Stack Overflow or respective owner