For more information see Automatically Generated Commands.The Update method retrieves rows from the table listed in the first mapping before performing an update.However, you can create a Sql Command Builder or Ole Db Command Builder object to automatically generate SQL statements for single-table updates if you set the Select Command property of a . Then, any additional SQL statements that you do not set are generated by the Command Builder.This generation logic requires key column information to be present in the Data Set.When an application calls the Update method, the Db Data Adapter examines the Row State property, and executes the required INSERT, UPDATE, or DELETE statements iteratively for each row, based on the order of the indexes configured in the Data Set.For example, Update might execute a DELETE statement, followed by an INSERT statement, and then another DELETE statement, due to the ordering of the rows in the Data Table.
After a row updates successfully, the changes to that row are accepted.
This capability is often used to include original values in the WHERE clause of an UPDATE statement to check for optimistic concurrency violations.
Note If an error occurs while updating a row, an exception is thrown and execution of the update is discontinued.
we will just focus on Concept and the code for this.
I will performe insert,delete and update operation on Data Set (Data Table) on Page_Load event. Step 3: Now we will update these changes to Database with the help of Update method of Sql Data Adapter object. Anything which is not clear to you, Please feel free to ask.
Search for updating datarow:
Generally we used Data Set for having the collection of Data.