Hi James,
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know how does ADO.NET work
when updating using a DataAdapter, and how to make update faster. If there
is any misunderstanding, please feel free to let me know.
In a DataTable, each DataRow object has a property named "RowState". It is
an enumeration value, which can be the following enumerations: Added,
Deleted, Modified, Unchanged. When DataAdapter.Update is called, the method
iterates through the row collection. It calls DataAdapter.InsertCommand on
Added rows, DeleteCommand on Deleted rows, UpdateCommand on Modified rows
and ignore the Unchanged rows. If Refresh data option is checked in
DataAdapter wizard or you have added a SELECT statement in the
InsertCommand, the inserted row will also be refreshed by the value
actually inserted into the database.
It will be very slow if we update the whole DataSet in a Web Service,
because we need to send all the rows to the server. However, the Unchanged
rows are just ignored. We can use DataSet.GetChanges method to get all the
rows whose RowState values are Added, Deleted or Modified. When updating,
we just pass the diffgram to server side and merge it back to the original
DataSet after updating. This saves much bandwidth.
Here are 2 KB articles about how to update server data through a web
service by using ADO.NET.
http://support.microsoft.com/default.aspx?scid=310143 http://support.microsoft.com/default.aspx?scid=313540
If the data in database has been changed after filling to the DataSet and
before updating, the DataAdapter will be aware of it and an
DBConcurrencyException will be thrown. Here is an article about how to
handle concurrency errors.
http://msdn.microsoft.com/library/de...us/vbcon/html/
vbwlkhandlingconcurrencyexception.asp
HTH. If anything is unclear, please feel free to reply to the post.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."