O'Reilly logo

Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition by Harvey M. Deitel - Deitel & Associates, Inc., Paul J. Deitel - Deitel & Associates, Inc.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

20.9. Using a DataSet to Read and Write XML

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.

Writing Data from a Data Source to an XML Document

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.

Figure 20.50. Writing the XML representation of a DataSet to a file.
						 1
						' Fig. 20.50: FrmXMLWriter.vb
						 2
						' Demonstrates generating XML ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required