XML can be loaded into a DataSet from a variety of sources, such as files or streams. Loading XML data from different sources often means using different method overloads in the DataSet. The specifics of loading XML data from a variety of sources are described in the following subsections.
To load an XML file into a DataSet, use the DataSet.ReadXml(string) method and pass in the name of the file to load. For example:
C# l_DataSet.ReadXml("\\MyDS.xml"); VB l_DataSet.ReadXml("\MyDS.xml")
After the XML is loaded, the DataSet is populated as if the data had been entered programmatically. If the XML file does not describe a valid DataSet, then an exception is thrown. Typical scenarios that cause exceptions ...