O'Reilly logo

Sams Teach Yourself ADO.NET in 24 Hours by Paul Bertucci, Jason Lefebvre

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

Serializing DataSets to XML

As mentioned in the preceding section, DataSets are represented internally by XML. Therefore, it is particularly easy to transfer a DataSet to an XML document and also to reverse the process.

Viewing the Contents of a DataSet

The example in Listing 10.3 uses the GetXml() method of the DataSet object to return the DataSet's contents in XML form as a string. First, a table of information is retrieved from the Customers table in the Northwind database. Then it is placed into a label Web control in a Web form in order to display it.

Listing 10.3. Viewing the Contents of a DataSet
 <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %> <HTML> <HEAD> <script language="VB" runat="server" > Sub ...

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