dataSource, WriteXML not saving changes

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!
 
A

Alcibiade

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top