Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. XML and Databases > A Disconnected XML Data Reader

A Disconnected XML Data Reader

By design, a data reader object works while connected, and so do any XML readers you might build on top of it. However, the .NET Framework provides a class that has the ability to expose a disconnected set of rows—a DataSet object—as XML. The DataSet object is designed as a disconnected object with no relationship to any living instance of a DBMS. The XmlDataDocument class takes a DataSet object and transforms it into an XML DOM object—that is, the XmlDocument class we analyzed in Chapter 5. In a nutshell, the XmlDataDocument class provides a client-side and an XML DOM representation of a disconnected set of rows. Let’s see how.

The XmlDataDocument Class

The XmlDataDocument class inherits from XmlDocument, and although it is defined in the system.data assembly, it belongs to the System.Xml namespace. A combined use of the XmlDataDocument class and the DataSet class provides access to the same data using two otherwise alternative approaches: relational and hierarchical. When a DataSet class and an XmlDataDocument class are synchronized, they work on the same set of data and detect each other’s changes in real time.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint