A powerful feature of ADO.NET is its ability to convert data stored in a data source to XML for exchanging data between applications in a portable format. Class DataSet of namespace System.Data provides methods WriteXml, ReadXml and GetXml, which enable developers to create XML documents from data sources and to convert data from XML into data sources.
The application of Fig. 20.50 populates a DataSet with statistics about baseball players, then writes the data to an XML document and displays the XML in a TextBox.
1 ' Fig. 20.50: FrmXMLWriter.vb 2 ' Demonstrates generating XML ...