dataSource, WriteXML not saving changes

  • Thread starter Thread starter Magus
  • Start date Start date
M

Magus

I have around 50-200 lines in a dataGridView. I also have a bindingNavigator, bindingSource, and a dataSet. The dataGridView and bindingNavigator are both set to bindingSource. I set the bindingSource.DataSource through code and call:

dataSet1.Clear();
dataSet1.ReadXml(fname, XmlReadMode.InferSchema);
bindingSource1.DataSource = dataSet1.Tables[0];

This reads the data just fine. However, any changes I make will not save. Here is the code I'm calling to save changes I've made in the dataGridView:

dataSet1.AcceptChanges();
dataSet1.WriteXml(directory + "\\" + ffile, XmlWriteMode.IgnoreSchema);

I'd appreciate any help offered. Thanks!
 
Il 17/05/2011 15:34, Magus ha scritto:
I have around 50-200 lines in a dataGridView. I also have a bindingNavigator, bindingSource, and a dataSet. The dataGridView and bindingNavigator are both set to bindingSource. I set the bindingSource.DataSource through code and call:

dataSet1.Clear();
dataSet1.ReadXml(fname, XmlReadMode.InferSchema);
bindingSource1.DataSource = dataSet1.Tables[0];

This reads the data just fine. However, any changes I make will not save. Here is the code I'm calling to save changes I've made in the dataGridView:

dataSet1.AcceptChanges();
dataSet1.WriteXml(directory + "\\" + ffile, XmlWriteMode.IgnoreSchema);

I'd appreciate any help offered. Thanks!

it seems ok.....Are you sure you are checking the right file? 8)
 
Back
Top