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.com...
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 FirstReturnedRecord, 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.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(DsStudentCourse1)
DsStudentCourse1.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.