473,703 Members | 2,976 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

very slow when updating dataset using AcceptChanges

does anyone experienced slowness when updating a dataset using
AcceptChanges?

when calling this code it takes many seconds to update the database

SqlDataAdapter1 .Update(DsStude ntCourse1)
DsStudentCourse 1.AcceptChanges ()

i'm also wondering because w/ out AcceptChanges the data is still save
into the database and it is now faster.

thanks in advance for any info.
Nov 20 '05 #1
10 5670
From MSDN:

When using Update, the order of execution is as follows:
1.The values in the DataRow are moved to the parameter values.
2.The OnRowUpdating event is raised.
3.The command executes.
4.If the command is set to FirstReturnedRe cord, then the first returned
result is placed in the DataRow.
6.If there are output parameters, they are placed in the DataRow.
7.The OnRowUpdated event is raised.
8.AcceptChanges is called.

So don't need to call explicitly AcceptChanges because the Update method
already does this.
Ernest


"jaYPee" <hi******@yahoo .com> wrote in message
news:33******** *************** *********@4ax.c om...
does anyone experienced slowness when updating a dataset using
AcceptChanges?

when calling this code it takes many seconds to update the database

SqlDataAdapter1 .Update(DsStude ntCourse1)
DsStudentCourse 1.AcceptChanges ()

i'm also wondering because w/ out AcceptChanges the data is still save
into the database and it is now faster.

thanks in advance for any info.

Nov 20 '05 #2
Thank you very much for the reply. however i have this scenario that
if i don't use AcceptChanges the record in the datagrid (which
contains related table) is not showing

this is the scenario:

i have a parent/child form that after clicking a checkbox in the
parent form the program will execute the stored procedure from sql
server 2000 then save the data in the related table that is based on
the criteria from the primary table and filling the datagrid (which
contains related table)

but i can't see the changes after clicking the checkbox if i don't use
AcceptChanges after an update.

thanks again for any info.

On Fri, 11 Jun 2004 10:21:15 +0200, "Ernest Morariu"
<er****@gesora. com> wrote:
From MSDN:

When using Update, the order of execution is as follows:
1.The values in the DataRow are moved to the parameter values.
2.The OnRowUpdating event is raised.
3.The command executes.
4.If the command is set to FirstReturnedRe cord, then the first returned
result is placed in the DataRow.
6.If there are output parameters, they are placed in the DataRow.
7.The OnRowUpdated event is raised.
8.AcceptChange s is called.

So don't need to call explicitly AcceptChanges because the Update method
already does this.
Ernest


"jaYPee" <hi******@yahoo .com> wrote in message
news:33******* *************** **********@4ax. com...
does anyone experienced slowness when updating a dataset using
AcceptChanges?

when calling this code it takes many seconds to update the database

SqlDataAdapter1 .Update(DsStude ntCourse1)
DsStudentCourse 1.AcceptChanges ()

i'm also wondering because w/ out AcceptChanges the data is still save
into the database and it is now faster.

thanks in advance for any info.


Nov 20 '05 #3
Hi jaYPee,

I have seen this as well, it is a weird scenario. Confirming to the
documentation this should not be necessary, however it is, it seems in my
eyes something with the datasource and not with the datagrid.

There was a kind of the same message from Herfried yesterday about an
arraylist.

Cor

this is the scenario:

i have a parent/child form that after clicking a checkbox in the
parent form the program will execute the stored procedure from sql
server 2000 then save the data in the related table that is based on
the criteria from the primary table and filling the datagrid (which
contains related table)

but i can't see the changes after clicking the checkbox if i don't use
AcceptChanges after an update.

Nov 20 '05 #4
not with the datatable
Nov 20 '05 #5
jayYPee,
Do you have a sample app that identifies this problem.

Are you updating both the Parent & the Child? Are you updating the tables in
the correct order? Are you updating rows in the correct order? (for possible
issues on updating in the correct order see Sceppa's book below).

As Ernest & Cor have stated, calling AcceptChanges after Update should not
be needed, as Update does call AcceptChanges!

You may have stumbled on a bug in the framework (either the dataset or the
datagrid), hence my asking if you have a sample that identifies the problem.
Especially if you can consistently recreate it.

For a good tutorial on ADO.NET as well as a good desk reference once you
know ADO.NET see David Sceppa's book "Microsoft ADO.NET - Core Reference"
from MS press.

Hope this helps
Jay
"jaYPee" <hi******@yahoo .com> wrote in message
news:ov******** *************** *********@4ax.c om...
Thank you very much for the reply. however i have this scenario that
if i don't use AcceptChanges the record in the datagrid (which
contains related table) is not showing

this is the scenario:

i have a parent/child form that after clicking a checkbox in the
parent form the program will execute the stored procedure from sql
server 2000 then save the data in the related table that is based on
the criteria from the primary table and filling the datagrid (which
contains related table)

but i can't see the changes after clicking the checkbox if i don't use
AcceptChanges after an update.

thanks again for any info.

On Fri, 11 Jun 2004 10:21:15 +0200, "Ernest Morariu"
<er****@gesora. com> wrote:
From MSDN:

When using Update, the order of execution is as follows:
1.The values in the DataRow are moved to the parameter values.
2.The OnRowUpdating event is raised.
3.The command executes.
4.If the command is set to FirstReturnedRe cord, then the first returned
result is placed in the DataRow.
6.If there are output parameters, they are placed in the DataRow.
7.The OnRowUpdated event is raised.
8.AcceptChange s is called.

So don't need to call explicitly AcceptChanges because the Update method
already does this.
Ernest


"jaYPee" <hi******@yahoo .com> wrote in message
news:33******* *************** **********@4ax. com...
does anyone experienced slowness when updating a dataset using
AcceptChanges?

when calling this code it takes many seconds to update the database

SqlDataAdapter1 .Update(DsStude ntCourse1)
DsStudentCourse 1.AcceptChanges ()

i'm also wondering because w/ out AcceptChanges the data is still save
into the database and it is now faster.

thanks in advance for any info.

Nov 20 '05 #6
Hi Jay,

I have already made an very simple sample not this problem however it looks
as this and sended it to the ADONET group in a discussion, however the
thread stopped after I had send it.

Are you interested?

Cor
Nov 20 '05 #7
On Fri, 11 Jun 2004 16:02:05 +0200, "Cor Ligthert"
<no**********@p lanet.nl> wrote:
Hi Jay,

I have already made an very simple sample not this problem however it looks
as this and sended it to the ADONET group in a discussion, however the
thread stopped after I had send it.

Are you interested?

Cor


yes i'm interested
Nov 20 '05 #8
Hi jaYpee,

Whith that sample I show the behaviour that you tell.

(It has to do with the position of a row in a datagrid)

With acceptchanges it is after an insert on the right place, while it is
whithout that at the end.

However for me a kind of same behaviour, as you tell.

(Adding rows in a datagrid and doing an acceptchanges after that is useless
of course, this for the ones who maybe will google this thread onces)

However the sample gives no solution.

Sorry

Cor
Nov 20 '05 #9
Cor,
Can you either post the code or email me it (a linke would work as well). I
don't really have time right now to search the ado group for it.

Thanks
Jay

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:eO******** ******@TK2MSFTN GP10.phx.gbl...
Hi jaYpee,

Whith that sample I show the behaviour that you tell.

(It has to do with the position of a row in a datagrid)

With acceptchanges it is after an insert on the right place, while it is
whithout that at the end.

However for me a kind of same behaviour, as you tell.

(Adding rows in a datagrid and doing an acceptchanges after that is useless of course, this for the ones who maybe will google this thread onces)

However the sample gives no solution.

Sorry

Cor

Nov 20 '05 #10

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

Similar topics

9
4204
by: Bill Salling | last post by:
am trying to updated the source data(Access2000) for my data grid. But keep getting this error An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dl Additional information: Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information I can get the error message to disapper by using the AcceptChanges action to the dataset, but...
0
1507
by: Steve Amey | last post by:
Hi all I have a form with some data bound to it. There is a list on the form that could display any number of records that the user requests. When changes are made to the data I use the GetChanges method to get a temporary DataSet to pass the the Business Object layer, then when the updates have been applied to the database I Merge and then AcceptChanges on the main DataSet.
6
1423
by: foobar | last post by:
Okay, I have created a Customers class. This class allows a user to select and update the customers table on an Sql Server database. I can retrieve the datatable generated by the class. Make changes to the table. Pass the table back to the class and update the backend with no problem However, here is my problem: After writing the table to xml using ds.writexml("path") and editing the document i then read the data into a dataset and...
11
8405
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 correctly, the Data Row is populated correctly, and the new row is added to the DataSet. But the database is not updated. What am I missing?
1
1147
by: Kai Thorsrud | last post by:
Hi, I've only got a typical crappy Microsoft book about ADO.NET (MSPRESS !"(¤#&/()&¤# you for mixing manual written code and suddenly adding designtime controls and wizards for updating data) I've got a function that is just for learning purposes the naming convention is bad and such since it's a mix of my conventions and MS Press conventions. I work with XML files in a database guy's approach. I've managed to create a schema for my...
14
2127
by: Lars Netzel | last post by:
A little background: I use three Datagrids that are in a child parent relation. I Use Negative Autoincrement on the the DataTables and that's workning nice. My problem is when I Update these grid and write to the database and I set the new Primary Keys and related Fields to the new asigned atuonumbers in the Access.
2
1825
by: Niels Jensen | last post by:
I have a some code which imports information from a text file to a dataset. Depending op what is being extracted from the text file, the dataset has 5 tables which can be written to. During this accessing I have to delete some records depending on certain criteria. I initially had some errors because I wasn't accepting the changes made to the dataset. So using .acceptchanges fixed the issue. however later on in the program a user may...
6
2333
by: mike11d11 | last post by:
I'm trying to create an application that will have multiple users working off a table on a SQL server. Since multi users will be updating different records at any given moment, how can i get those changes and merge them into my current Dataset. I've been playing around with the GetChanges method and Acceptchanges but they just dont seem to be pulling over the changes and updating my Dataset. Maybe if someone could give me a sample of...
1
2370
by: jonbartlam | last post by:
Hi There I'm not sure what exactly is going wrong here. I'm writing an application that retreives a table from a database (tbl_internalfaults) and updates it. (Actually, just the status column will need updating with 'CLOSED' where necessary.) I have been trying to use the OLEDB command builder to build the statement to update the database however it is returning an error whenever I try to do this. I already have a dataset full of data, 1...
0
8749
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8662
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9243
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7853
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6585
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5922
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4420
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2434
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.