O'Reilly logo

C# Primer: A Practical Approach by Stanley B. Lippman

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

5.11. System.Xml

The representation of relational table data can be poured like water back and forth between a DataSet object and an XML representation. In particular, the XmlDataDocument class, defined in the System.Xml namespace, has a special relationship to the DataSet class. It allows us to load relational data (or XML data, of course) and manipulate that data using the W3C Document Object Model (DOM). One way to do the binding is to pass the DataSet object to the XmlDataDocument constructor:

DataSet ds = new DataSet();
adapter.Fill( ds, "FOOD_DES" );

XmlDataDocument xmlDoc = new XmlDataDocument( ds );

Now we can manipulate the XmlDataDocument just as if we had directly loaded it with XML data. In this section we look at the DOM, its navigation ...

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