PC Review


Reply
Thread Tools Rate Thread

dataSource, WriteXML not saving changes

 
 
Magus
Guest
Posts: n/a
 
      17th May 2011
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!
 
Reply With Quote
 
 
 
 
Alcibiade
Guest
Posts: n/a
 
      17th May 2011
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)

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: dataSource, WriteXML not saving changes Magus Microsoft C# .NET 0 17th May 2011 03:30 PM
OK my subform is not entering saving the key from the master datasource. Avid Fan Microsoft Access Form Coding 12 17th May 2010 11:31 PM
saving datasource in mail merge with selections =?Utf-8?B?SGVsZW4gQw==?= Microsoft Word New Users 1 31st Mar 2005 06:57 PM
saving Ascii file text as dataset and using it as combobox datasource Nicholas Paldino [.NET/C# MVP] Microsoft C# .NET 3 29th Mar 2004 11:39 PM
saving changed data from dataset to datasource @piranha Microsoft VB .NET 1 2nd Nov 2003 07:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:16 PM.