I am having problems to write DataTable to XML document and read back the same XML document to the DataTable.
The Following is the Code, please help. Thanks in advance.
//TO READ A FILE
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
myDT_For_DGV.ReadXml(@openFileDialog1.FileName);
//MessageBox.Show(openFileDialog1.FileName);
}
//TO WRITE TO XML
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);
}