Thanks Dave for your reply. Applying AcceptChanges() to the dataset before
I apply the update method doesn't do what I want it to do.
Okay here is the DataViewRowState when ds.AcceptChanges() is commented out:
//# of records added: 1
//# of CurrentRows: 1
//# of records Deleted: 0
//# of records ModifiedCurrent: 0
//# of records ModifiedOriginal: 0
//# of records .None: 0
//# of records OriginalRows: 0
//# of records Unchanged: 0
and a new record is inserted into the backend.
Here is the DataViewRowState using ds.AcceptChanges():
//# of records added: 0
//# of CurrentRows: 1
//# of records Deleted: 0
//# of records ModifiedCurrent: 0
//# of records ModifiedOriginal: 0
//# of records .None: 0
//# of records OriginalRows: 1
//# of records Unchanged: 1
and there is no change to the backend. I expected an update on the record.
"Dave" <NO*********@dotcomdatasolutions.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
...try to update the back-end using the edited xml document. The process
errors and says i need and Insert command...
After you read the rows into the dataset, you must call AcceptChanges()
since they are new, "inserted" rows.
However, calling AcceptChanges() will apply all changes to the DataSet,
including previous updates.
So, perform any updates that you have first.
Then, read the xml into the DataSet.
You must specify an InsertCommand, to your DataAdapter, that can perform
the inserts correctly.
--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"foobar" <es***@inbizservices.com> wrote in message
news:eq**************@TK2MSFTNGP09.phx.gbl... 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 then try to update the back-end using the edited xml
document. The process errors and says i need and Insert command. Well -
I should need an insert. It is an update! What is going on?