Когда я пытаюсь удалить некоторые из моих дочерних элементов с помощью RemoveChild(). Но выбросьте исключение. Я прикрепил свой код ниже.
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
Показать ошибку ниже:
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.
Как удалить узел?
[Обновление]
Используются VS2005 и .NET 2.0.
childNode.ParentNode.RemoveChild(childNode)
- person Josh M.   schedule 10.07.2012