How to Convert complex XML structures to DataSet with multiple tables
What is the best way to convert an XML document to a .NET 2.0 DataSet. The XML document contains complex structures with parent-child relationships and should be transformed into multiple tables in the DataSet. The DataSet tables should also maintain the relationship among tables. right now, I've to write custom XSLT to do this transformation
The best (meaning easiest) way, that also includes all the parent/child relationships is...
DataSet myDataSet = new DataSet(); myDataSet.ReadXml("myXmlFile.xml");
BTW, if you have the XML in memory (and not in a file), then you can use one of the "ReadXml" overloads to read it from a stream.