Posted on: 4/23/2014 6:18:51 AM | Views : 368

Hi Folks,
I have a treeview in my webpage, and I'm able to add child nodes without any problem, but I want to add them to collection first before allowing the user to press a button to save them one by one. My only problem is the parentID when save in the database. So how do I temporarily set the parent ID of each node before finally getting the permanent parent ID from the database and overwriting the temporary ID that I have set?
0 - parent
0.1 - child
0.1.1 - sub-child
0.1.1.1 - sub-sub-child
 
so how do I save this to a collection, then read them one by one to save to database and use the scope-identity returned by insert to assign to the parentID column in the same table? I can use the "..selectednode.parent." property of treeview, but i think the complicated thing I need to be able to set the parent-child relationship while they're in the collection before saving them. Btw, the parentID should be the ...

Go to the complete details ...