I load this file into forms controls - without problems, but if i change the value of some controls and want to update particular xml node - nothing happens. For example, i want to change the price of apple, according to my TextBox1.Text:
file01 = new XmlDocument();
file01.Load(filePath);
XmlElement root = file01.DocumentElement;
XmlNodeList nodes = root.SelectNodes("/Food/Fruit");
foreach (XmlNode node in nodes)
{
if (node["name"].InnerText == "apple")
{
node["price"].InnerText = textBox1.Text;}}
I also tried TextBox1.Text convert to string - also nothing happend. XML file remains unchanged.
Any suggestion, pls. How to finish ?


VulpesRank #55 · 29.2K reputationPosted Apr 15, 2012, 9:22 AM EDT
file01.Save(filePath);
Memento104 reputationPosted Apr 15, 2012, 10:51 AM EDT
ThankYou, Man.
VulpesRank #55 · 29.2K reputationPosted Apr 15, 2012, 10:52 AM EDT