XML string to DataTable
-
Hi, I'm trying to do something that seems pretty easy. I have a xml string that I want in a datatable. After some testing, I think the biggest problem is getting the schema into a new datatable from a xml string. public void XMLStringToDataTable(string as_xml, ref DataTable adt_working) { if (adt_working == null) adt_working = new DataTable(); StringReader lstr_temp = new StringReader(as_xml); XmlTextReader lxmlReader = new XmlTextReader(lstr_temp); adt_working.ReadXmlSchema(lxmlReader); adt_working.ReadXml(lxmlReader); adt_working.AcceptChanges(); } Is there any easier/ better way to do this? One that works? I would like to use a datatable instead of a dataset if possible. sample xml string: 62291905/4/2006 00:00:002test5/4/2006 00:00:00N16471678 Thanks, Jessica