I have a small windows application which reads from an xml file and then displays it into a DataGridView.
private void Form1_Load(object sender, EventArgs e)
{
XmlDataDocument xmlDatadoc = new XmlDataDocument();
xmlDatadoc.DataSet.ReadXml("C:\\testxml.xml");
DataSet ds = new DataSet("Books DataSet");
ds = xmlDatadoc.DataSet;
dataGridView1.DataSource = ds.DefaultViewManager;
dataGridView1.DataMember = "Book";
}
this works fine and it displays the data perfectly, but now i wan't to be able to edit the data in the DataGridView and press a button to write the edited data to the xml file.
I have tried putting the DataGridView back into the created DataSet but i have yet to find a way to do this.
Is there a way to put the DataGridView into a DataSet? maybe looping through the DataGridView? i have no idea where to start with this.
or would it maybe be easier to use an .mdb for this, with OleDb?
my main goal is to be able to read data into a DataGridView and then be able to edit the data and save it.

New Topic/Question
Reply



MultiQuote




|