I have an XmlDocument and get the bytes of the object as follows:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("C:\\myxml.xml");
byte[] data = Encoding.UTF8.GetBytes(xmlDocument.outerXml);
and data is stored in a database.
Now I am reading the byte[] data back out, and want to get back to the XmlDocument object. How can I do this, as I cannot simply case the byte[] to an XmlDocument?
Thanks.
You could use the LoadXml method:
UPDATE:
As requested in the comments section here’s how to load the byte array into a
DataTable: