Synchronizing XML and DataSets
So far in this chapter, we focused on converting XML to a DataSet or a DataSet to XML. It is also possible to make changes to a DataSet or the XML and have the changes reflected back in the other format. For example, if I load a DataSet I can get an updateable XML view of the DataSet. If I make changes to the XML, the changes are immediately reflected in the DataSet. If I make changes to the DataSet, the changes are immediately reflected in the XML.
Let's walk through an example showing this. Here is an XML Schema defining an XML document that contains company information. The file is named Company.xsd and includes department and employee information:
<?xml version="1.0" standalone="yes"?> <xsd:schema id="Company" ...
Get Visual Basic® .NET by Example now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.