Hi I want to save and load data from a datagridview to a xml. My idea is that I can save my datagridview to a xml how this -> "[date]_[name].xml" and later I can load this data. For this two operations I want to use two methods --> Save() and Load()
Here is my code for saving:
private void Save(DataGridView grid)
{
try
{
xmlfile = @"C:\datagrid.xml";
dataset = (DataSet)InputDataGrid.DataSource;
dataset.WriteXml(xmlfile);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
How I can do this?
This is the sample xml file which I have used for testing your scenario:
The sample code snippet which could access the above mentioned XML file:
--SJ