The XmlPhoneBook sample application demonstrates how to load and save DataSet s in XML format. The XML can be stored on the local file system or through a stream associated with an IrDAClient . There is a C# and VB version of XmlPhoneBook in the folder \SampleApplications\Chapter8 . When the XmlPhoneBook application launches, the screen shows a DataGrid and a series of buttons . The DataGrid shows the contents of a DataSet maintained by the application. To set up a brand new DataSet , follow these steps:
To save a DataSet to an XML file, click the XML File Save button. The application saves the DataSet in XML format to the file \PhoneBook.xml. To load a previously saved DataSet , click the XML File Load button. The application attempts to populate the DataSet by loading the file \PhoneBook.xml. XmlPhoneBook can also transmit a populated DataSet by using the infrared port. To do this, follow these steps:
There is neither a way to edit the records, nor to choose values for records to insert, nor to choose the filename for saving the DataSet as XML data. This is to keep the application simple and maintain a focus on loading and saving DataSet s in XML format, rather than creating an exercise in user interface design. |