473,396 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

dataset.ApplyChanges() not taking effect.

Here is my code.

Does anyone know why when i reopen the table to view the data, none of the
rows have been written?

DownloadFileDataSet.DownloadFileRow MainTableRow =
(DownloadFileDataSet.DownloadFileRow)downloadFileD ataSet.DownloadFile.NewRow();
MainTableRow.Date = DateTime.Now;
MainTableRow.RowID = gDownloadFileTableGUID;
MainTableRow.FileName = sFileName;
MainTableRow.URL = sSource;
MainTableRow.FileSize = iFileLength.ToString();
downloadFileDataSet.DownloadFile.AddDownloadFileRo w(MainTableRow);

//Save the dataset to the database
downloadFileDataSet.AcceptChanges();
Jul 21 '08 #1
3 1926
* * * * * * //Save the dataset to the database
* * * * * * downloadFileDataSet.AcceptChanges();
IIRC AcceptChanges do not save the changes to the DB, only to the
dataset in memory
Jul 21 '08 #2
How do i save the changes to the DB?

"Ignacio Machin ( .NET/ C# MVP )" wrote:
>
//Save the dataset to the database
downloadFileDataSet.AcceptChanges();

IIRC AcceptChanges do not save the changes to the DB, only to the
dataset in memory
Jul 21 '08 #3
On Mon, 21 Jul 2008 13:28:16 -0700, greatbarrier86 wrote:
How do i save the changes to the DB?
I had exactly the same problem ended up with:

internal void UpdateDatabase()
{
EndEditOnAllBindingSources();

tableAdapterManager.UpdateAll(scoreDataset);

}
private void EndEditOnAllBindingSources()
{
var BindingSourcesQuery =
from Component bindingSources in
this.components.Components
where bindingSources is BindingSource
select bindingSources;

foreach (BindingSource bindingSource in BindingSourcesQuery)
{
bindingSource.EndEdit();
}
}

Jul 22 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

40
by: Peter Row | last post by:
Hi all, Here is my problem: I have a SQL Server 2000 DB with various NVarChar, NText fields in its tables. For some stupid reason the data was inserted into these fields in UTF8 encoding. ...
2
by: Gopal | last post by:
Hi, I've a module report.py having a set of funtions to open/close/write data to a log file. I invoke these functions from another module script.py. Whenever I'm changing something in...
1
by: John | last post by:
Hi All, When I delete the last record from my dataset and then WriteXML() to the file; the Table itself, in the xml file, is removed. I need to prevent the table structure from being deleted if...
35
by: MuZZy | last post by:
Hi All, I got a issue here and hope someone can help me: Let's consider this code: // =================== CODE START ================================= using System; using System.Data; ...
2
by: Chris | last post by:
Hi, I have a desktop app written in vb.net. It takes a wile to load from sql server via a stored proc. Is there a way I can cache the dataset so that If i reopen the the program it loads faster. The...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
3
by: Imran Aziz | last post by:
Hello All, I have a dataset that I populate using a SQL Server database, and the second one that I populate using a mySQL Server database, I need to combine the results in memory and then sort...
1
by: None | last post by:
Hi, I have developed webshop application using asp.net 1.1. I'm using DataGrid in one of the pages of my site. During the page load the DataGrid will be binded by around 7500 products(rows). At...
3
by: tshad | last post by:
Using asp.net 2.0, I am finding that at times, the old javascript will still be there. I was working with it for a couple of hours and the changes seem to happen. But at the end of the day, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.