Click here to Skip to main content
15,908,444 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All
I want to update selected node in xml file in windows form

Thanks in advanced
Posted

1 solution

This is a way to update a single node, if this is what you need :)

C#
XmlDocument doc = new XmlDocument();
doc.Load("yourPathOrStream");

doc.SelectSingleNode("//root//childNode//childOfChild").InnerText = "something";
doc.Save("filename");
 
Share this answer
 
v2
Comments
mmsalman87 10-Jul-12 6:15am    
how i can get the current node path ?
pykos 10-Jul-12 7:09am    
doc.SelectSingleNode("//root//firstchild//childOfFirstChild...").InnerText = "something";

mmsalman87 12-Jul-12 2:54am    
i want to get the node dynamically
pykos 12-Jul-12 6:18am    
could you be more specific? I dont know what you mean exactly...

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