Converting a C# DataTable instance to xml that contains HTML or binary data
- by Wardy
Hmmmm ...
Although it works in most cases, one column has html data in it.
It seems that doing this ...
StringBuilder xmltarget = new StringBuilder();
XmlWriter xmlWriter = XmlWriter.Create(xmltarget);
tableData.WriteXml(xmlWriter);
... doesn't identify where this html or binary data exists and wrap the data in cdata tags as it should ...
Is there something i need to do to ensure the relevant checks are made and a working xml string is produced?