Menu
Carl Camera

XmlDocument to DataSet

XmlDocument to DataSet in two lines. This is the quickest conversion I've found so far.

XmlDocument xdoc = MethodReturnsXmlDocument();

// convert to DataSet
DataSet ds = new DataSet();
ds.ReadXml(new XmlNodeReader(xdoc));

Comments