yes i have done this using text box i can share my code with you
public bool updateNode(String objName, String objSheetNames)
{
XmlDocument objXMLDocument = new XmlDocument();
objXMLDocument.Load(xmlPath);
XmlNode objNode = null;
ArrayList ls = searchNode(objName, objXMLDocument);
String[] sheetNamesList = objSheetNames.Split(',');
if (ls.Count != 0)
{
objNode = (XmlNode)ls[0];
XmlNode parentNode = objNode.ParentNode;
XmlNode childNode = parentNode.LastChild;
foreach (String val in sheetNamesList)
{
XmlNode appendedNode = objXMLDocument.CreateElement("SName");
appendedNode.InnerText = val;
childNode.AppendChild(appendedNode);
}
objXMLDocument.Save(xmlPath);
return true;
}
else
{
return false;
}
}
here i used "SNAME" as the name of my node which i wanted to update
and here is the code behind the button
private void button4_Click(object sender, EventArgs e)
{
string objName = textBox1.Text;
string objSheetNames = textBox2.Text;
bool objverify = c.updateNode(objName, objSheetNames);
if (objverify == true)
{
MessageBox.Show("Record Updated");
}
else
{
MessageBox.Show("Record Cannot be added.Already Exists");
}
}
i used the root node(objName ) for which child i wanted to update