document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. using System;
  2. using System.Windows.Forms;
  3. using System.Data;
  4.  
  5. namespace XSD_Demo
  6. {
  7.     public partial class Form1 : Form
  8.     {
  9.         public Form1()
  10.         {
  11.             InitializeComponent();
  12.         }
  13.  
  14.         private void userInfoBindingNavigatorSaveItem_Click(object sender, EventArgs e)
  15.         {
  16.             //this simple command will save the entire in-memory dataset to a disk file.
  17.             dataSet1.WriteXml("mydata.xml");
  18.         }
  19.  
  20.         private void dataSet1_Initialized(object sender, EventArgs e)
  21.         {
  22.             if (!System.IO.File.Exists("mydata.xml"))
  23.             {
  24.                 dataSet1.WriteXml("mydata.xml", XmlWriteMode.WriteSchema);
  25.             }
  26.             dataSet1.ReadXml("mydata.xml", XmlReadMode.ReadSchema);
  27.         }
  28.     }
  29. }
');