Best way to insert nested tree node data hierarchy into db tables

  • Thread starter Thread starter Sudip_inn
  • Start date Start date
S

Sudip_inn

Guest
suppose i have a treeview by which i am designing menu hierarchy and after design i want to store that nested menu hierarchy into db table. so what would be best way. if i do insert one by one just iterate treeview each node then it will take bit long time to complete the operation and if i do it by sql server store proc then i have to know how to iterate Node hierarchy in xml format at sql server end. when node hierarchy is Nth level means parent node has child node and child node has Nth child node inside it then it is getting very hard for me to parse the Nth nesting. so please suggest me to save the tree node hierarchy in db table.

sample menu hierarchy

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<menu version="1" title="Class Reference" src="docs/html/src/overviews/intro.txt" >
<item src="docs/html/src/overviews/base.txt" title="Base">
<item dest="uvm_pkg-uvm_object.html" title="uvm_object"/>
</item>
<item src="docs/html/src/overviews/phasing.txt" title="Phasing">
<item src="docs/html/src/overviews/test-phasing.txt" title="User Defined Phasing"/>

<item src="docs/html/src/overviews/phasing.txt" title="Phasing">
<item src="docs/html/src/overviews/test-phasing.txt" title="User Defined Phasing"/>
<item src="docs/html/src/overviews/phasing.txt" title="Phasing1">
<item src="docs/html/src/overviews/test-phasing.txt" title="User Defined Phasing1"/>
<item src="docs/html/src/overviews/phasing.txt" title="Phasing2">
<item src="docs/html/src/overviews/test-phasing.txt" title="User Defined Phasing3"/>
</item>
</item>
</item>
</item>
</menu>


but in reality hierarchy would be more nested items.

thanks

Continue reading...
 
Back
Top