using System;
using System.Windows.Forms;
using System.Data;
namespace XSD_Demo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void userInfoBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
//this simple command will save the entire in-memory dataset to a disk file.
dataSet1.WriteXml("mydata.xml");
}
private void dataSet1_Initialized(object sender, EventArgs e)
{
if (!System.IO.File.Exists("mydata.xml"))
{
dataSet1.WriteXml("mydata.xml", XmlWriteMode.WriteSchema);
}
dataSet1.ReadXml("mydata.xml", XmlReadMode.ReadSchema);
}
}
}