An unhandled exception of type System.ArgumentException occurred in System.Private.Xml.dll: The node to be inserted is from a different document context

75

An unhandled exception of type 'System.ArgumentException' occurred in System.Private.Xml.dll: 'The node to be inserted is from a different document context -

XmlNode oNode = moDoc.CreateNode(sNodeType, sName, sNamespaceURI);

//necessary for crossing XmlDocument contexts
XmlNode importNode = oParent.OwnerDocument.ImportNode(oNode, true);

oParent.AppendChild(importNode);
return oNode;

Comments

Submit
0 Comments