title: Convert DataTable to XML file and viceversa
body: <p>I am having a problem with reading an XML file onto a <code>DataTable</code>. Initially, I am writing a <code>Datatable</code> to an XML file and saving it. Now, when I want to read the XML file back to the <code>DataTable</code>, it's not happening.</p>
  
  <p>The following code is for writing the file:</p>
  
  <pre><code>private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) 
  {
      if (myDT_For_DGV.Rows.Count != 0)
      {
          saveFileDialog1.ShowDialog();
          saveFileDialog1.FileName = "checkOutFile.xml";
          myDT_For_DGV.TableName = "CheckOutsAndIns";
          myDT_For_DGV.WriteXml(saveFileDialog1.FileName, true);
      }
      else
      {
          MessageBox.Show("Please add licences to DataGridView, you havent added any licences as of now", "Alert");
      }
  }
  </code></pre>
  
  <p>And for reading the file:</p>
  
  <pre><code>private void openToolStripMenuItem_Click(object sender, EventArgs e)
  {
      //write code to open file
      if (openFileDialog1.ShowDialog() == DialogResult.OK)
      {
          //myFile = openFileDialog1.FileName;
          System.IO.MemoryStream xmlStream = new System.IO.MemoryStream();
  
          xmlStream.Position = 0;
  
          myDT_For_DGV.ReadXml(openFileDialog1.FileName);
          //MessageBox.Show(openFileDialog1.FileName);
      }
  }
  </code></pre>