473,322 Members | 1,188 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,322 software developers and data experts.

DataSet.AcceptChanges?

I can't get this method to work as I expect it to. If I edit a row within a
DataSet, then invoke the DA's Update, the changes to the current row are
lost. If I move off the modified row then invoke Update the changes are
written to the back end. I assumed that AcceptChanges would cause any
changes in the current row to be included in the Update process, but those
changes are still being lost.

How do I ensure that the current rows changes will be included in the DA's
Update call?
Nov 17 '05 #1
4 7581
Christopher Weaver <we*****@verizon.net> wrote:
I can't get this method to work as I expect it to. If I edit a row within a
DataSet, then invoke the DA's Update, the changes to the current row are
lost. If I move off the modified row then invoke Update the changes are
written to the back end. I assumed that AcceptChanges would cause any
changes in the current row to be included in the Update process, but those
changes are still being lost.


No, quite the opposite. AcceptChanges is used to tell the DataSet that
all the modifications have been successfully accepted. Don't call
AcceptChanges manually and everything should be okay.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2
So how do I tell the DataSet to include the current row's changes in the
Update process? Unless I move off the row they are lost.
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Christopher Weaver <we*****@verizon.net> wrote:
I can't get this method to work as I expect it to. If I edit a row
within a
DataSet, then invoke the DA's Update, the changes to the current row are
lost. If I move off the modified row then invoke Update the changes are
written to the back end. I assumed that AcceptChanges would cause any
changes in the current row to be included in the Update process, but
those
changes are still being lost.


No, quite the opposite. AcceptChanges is used to tell the DataSet that
all the modifications have been successfully accepted. Don't call
AcceptChanges manually and everything should be okay.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 17 '05 #3
Christopher Weaver <we*****@verizon.net> wrote:
So how do I tell the DataSet to include the current row's changes in the
Update process? Unless I move off the row they are lost.


IIRC, you call EndEdit on the row. You should probably ask on the
adonet newsgroup though - it's a while since I've done data binding.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #4
I'll look into it. Thanks.
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Christopher Weaver <we*****@verizon.net> wrote:
So how do I tell the DataSet to include the current row's changes in the
Update process? Unless I move off the row they are lost.


IIRC, you call EndEdit on the row. You should probably ask on the
adonet newsgroup though - it's a while since I've done data binding.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 17 '05 #5

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

Similar topics

1
by: ScottDizzy | last post by:
I'm trying to load an xml file into a dataset, then load the same xml file with a slight change into a second dataset, then do a merge to see what changed between datasets. DataSet xmlDataSet...
1
by: Shahar | last post by:
Hi what's worng with the following code, the chages I made is only change the DataSet but not the Data-Base: try { DataSet ds = new DataSet(); OleDbDataAdapter adapter = new...
2
by: Mojtaba Faridzad | last post by:
Hi, Please check these lines: DataSet dataSet = new DataSet(); dataAdapter.Fill(dataSet, "mytable"); DataRow row; row = dataSet.Tables.Rows; row.BeginEdit(); row = "555";
7
by: Zachary Hilbun | last post by:
The below is some test code to help me learn how to update a dataset. It is supposed to read the value of UserCounter and write it back. The UserCounter is being read correctly as 0, is 1 when...
2
by: Calvin KD | last post by:
Hi everyone, I know the solution to my problem is probably very simple but I just can't seem to figure out how to do it. My problem is, I have an XML file as a datastore, I read it into a dataset...
11
by: tomp | last post by:
Hi, I am trying to insert a row into the Categories Table in Nothwinds database in MSDE. I am able to manually insert it using a query tool. Using the Debugger, it appears the DataSet loads...
10
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1)...
12
by: Graham Blandford | last post by:
Hi all, Would someone be able to tell me the most 'graceful' way of removing unwanted rows from a dataset based on a condition prior to update? OR, resetting the rows all to unchanged after they...
0
by: buk110 | last post by:
Hi guys, I'm really hoping that someone can help me... I have 3 datasets. One that will contain the initial information when I open up the database; one that will pull in information afterwards;...
12
by: Brian | last post by:
I want to create an In Memory dataset. not connected to any database.. but putting my own info in from code or a file.... What are the steps to do this? Where can I find some info on how to do...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.