Hai
i ve an xml file in the format
<
Root>
<ID>A</ID>
<ID>B</ID>
<ID>C</ID>
</
Root>
I want to delete the node whose ID is "B" ... how can i do this ??
The code that i wrote is
Dim xpathquery as String
Dim doc as new XmlDocument
Dim selectedNode,main_node as XmlNode
doc.Load(filnam)
xpathquery = "/Root[ID='" & txtID.Text & "']"
selectedNode = doc.SelectSingleNode(xpathquery)
main_node = doc.SelectSingleNode(xpathquery) doc.DocumentElement.RemoveChild(main_node)
doc.Save(filnam)
when i tried executing this code i m getting the error "the node to be removed is not a child of this node " ... how can i correct this error ?? Can anybody help me ??
Any help appreciated ...
Thanx in Advance
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).