Updating a Data Store

After the data has been retrieved and modified by your application, you need to resynchronize it with the data store. Keep in mind that because we're dealing with the disconnected model here, the data adapter handles updates in a batch fashion. In other words, when its overloaded Update method is called, it looks for all changed rows in the given DataSet, DataTable, or array of DataRow objects, and attempts to run the InsertCommand, UpdateCommand, or DeleteCommand associated with the data adapter as appropriate. Of course, as you learned on Day 5, “Changing Data,” the data adapter makes the determination about how a row was changed by looking at the value of its RowState property. It hardly needs to be said that for a data ...

Get Sams Teach Yourself ADO.NET in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.