Re: Dataapter only updates local dataset
Calling AcceptChanges prior to the update tells the dataset to commit all changes since the last AcceptChanges was called.This changes there state from Modified/Added to unchanged. When Update() is called it performs a DataTable.GetChanges() and looks for any changes. Since you called AcceptChanges() there are no changes to commit to the database. This assume there isn't anything wrong with your Insert, Update, or Delete commands.
The correct steps in the case of a datagrid is to
1. binding manager.EndCurrentEdit()
2. Adapter.Update( ds, "Table") or Adapter.Update( (DataTable)DataGrid.DataSource )
3. Then DataTable.AcceptChanges() or (DataTable)DataGrid.DataSource.AcceptChanges()
If this doesn't help try posting a code snippet so I can see what your commands look like.
Subject
Written By
Posted
November 21, 2004 06:37AM
Re: Dataapter only updates local dataset
November 21, 2004 05:54PM
November 22, 2004 02:44AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.