Hello, When I try to remove some of my child element with RemoveChild(). But throw exception. I attached my code below.
nodeName = doc.SelectSingleNode("//Equipment//DataCollections//EnabledIDs//MyID[@id='" + attrValue + "']");
// Found the nodeName successfully druing run time.
doc.DocumentElement.RemoveChild(nodeName);
// faild to Remove the node
Show error below:
An unhandled exception of type 'System.ArgumentException' occurred in System.Xml.dll
Additional information: The node to be removed is not a child of this node.
How can I remove the node?
[Update]
VS2005 & .NET 2.0 used.