hi friends, I have an xml file and i add a node to it using the following code.
LoadXmlDoc.Load("first.XML")
LoadXmlDoc_2.Load("second.XML")
Dim NodeToCreateOrReplace_2 As XmlNodeList = LoadXmlDoc_2.GetElementsByTagName("SB")
Dim NodeToCreateOrReplace As XmlNodeList = LoadXmlDoc.GetElementsByTagName("SB")
Dim newnode As XmlNode, currNode
'XmlNodeList NodeToCreateOrReplace = LoadXmlDoc.GetElementsByTagName(XmlTagNameTxtBx.Te xt);
Try
For Each selectednode As XmlNode In NodeToCreateOrReplace
Dim node As XmlNode = selectednode.SelectSingleNode("SBN")
For Each selectednode1 As XmlNode In LoadXmlDoc_2
Dim node_2 As XmlNode = selectednode.SelectSingleNode("SBN")
If node.InnerText = node_2.InnerText Then
Dim docFrag As XmlDocumentFragment = doc.CreateDocumentFragment()
docFrag.InnerXml = selectednode1.OuterXml
currNode = LoadXmlDoc.DocumentElement("SBS").SelectSingleNode ("SB")
currNode.InsertAfter(LoadXmlDoc.ImportNode(docFrag , True), currNode.lastChild)
End If
Next
Next
im getting error "The element list has changed. The enumeration operation failed to continue." please help.