sql - parent child table to xml -


i have following table.

 id name parentid  ----------------  1  root null  2  child 1  3  child b 2  4  child c 1 

can point me in right direction export xml in either c# or sql server while supporting hierarchy?

<node>root</node> <children>    <node>child a</node>      <children>        <node>child b</node>      </children>     <node>child c</node>   </children> 

i ended using approach in c#.

http://w3facility.org/question/converting-datatable-into-json-tree-while-maintaining-parent-child-relationship/

basically take datatable, place hierarchical object, , serialize json. worked charm.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -