When using a database and performing data entry,
records are usually automatically saved as the user moves on, although
this functionality must be implemented by the database developer. If you
want, you can save the records of a table in an XML file. This is easily
done by calling the DataSet::WriteXml() method.

From the Server Explorer, expand the Servers node, down to the pubs
database

Drag the stores table and drop
it on the form

Right- click the sqlDataAdapter1 icon in the lower section of the
form and click Generate Dataset...

Click the text box to the right of the New radio button and change
it to dsStores

Click OK

On the Windows Forms section of the Toolbox, click DataGrid and
click the form

Position the DataGrid to the top-left corner and enlarge it

Right-click the DataGrid and click Auto Format

In the Formats list, click Professional 1

Click OK

On the form, click the DataGrid to make it is selected. In the
Properties windows, change the following properties:
CaptionText: Book Publishing - Stores
DataSource: dsStores1.stores
Anchor: Top, Bottom, Left, Right

Add a button to the bottom-left section of the form. Set its Name
to btnLoad and its Caption to Load

Add another button to the bottom-middle section of the form. Set its
Name to btnSaveAsXML and its Caption to Save As XML

Add a button to the bottom-right section of the form. Set its Name
to btnClose and its Caption to Close

Set the Anchor of all three buttons to Bottom only

Double-click the Load, the Save As XML, and the Close buttons to generate
their events