Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.33/5 (2 votes)
See more:
Hi all

In my ASP.Net application i'm binding a treeview from database. Also i have done coding to save child elements to DB by clicking on a tree node. Now i want to know the code for deleting nodes from the tree view as well as in the DB ?
treeView1.Nodes.Remove(treeView1.SelectedNode);
by using this i can remove nodes from tree view but not from DB , so when i refresh the page deleted nodes again displayed.
Posted
Updated 4-Jan-14 7:06am
v2
Comments
Sergey Alexandrovich Kryukov 4-Jan-14 2:24am    
What's wrong with just reading the MSDN documentation?!
—SA

When you remove the node, delete the row in the table so next time node does not refresh with the value.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 4-Jan-14 13:05pm    
This is a right approach with a data-bound control, a 5.
—SA
Abhinav S 4-Jan-14 13:43pm    
Thank you SA.
Espen Harlinn 5-Jan-14 12:04pm    
5'ed!
Abhinav S 5-Jan-14 12:09pm    
Thank you Espen.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900