I assume I have to do this via a DataSet, but it doesn't like my syntax.
I have an XMLDocument called "XmlDocument xmlAPDP".
I want it in a DataTable called "DataTable dtAPDP".
I also have a DataSet called "DataSet dsAPDP".
-
if I do DataSet dsAPDP.ReadXML(xmlAPDP) it doesn't like that because ReadXML wants a string, I assume a filename?
No hacks required:
xmlAPDP = new XmlDocument()
...
xmlReader = new XmlNodeReader(xmlAPDP)
dataSet = new DataSet()
...
dataSet.ReadXml(xmlReader)
XmlDocument is an XmlNode, and XmlNodeReader is a XmlReader, which ReadXml accepts.