Updating dataset asp net

Figure 5: Clicking the Delete Button in the Grid View Invokes the Sql Data Source s SQL statements can be specified through the Properties window or the control s declarative syntax.

However, this approach requires that we manually write out the SQL statements by hand, which can be monotonous and error-prone.

When the Sql Data Source control s method is invoked either programmatically or automatically from a data Web control a connection to the database is established, the parameter values are assigned to the query, and the command is shuttled off to the database.

The results are then returned as either a Data Set or Data Reader, depending on the value of the control s value has been specified, the Enable Inserting, Enable Editing, or Enable Deleting option in the corresponding data Web control s smart tag will become available.

In previous tutorials we learned how the Object Data Source control allowed for inserting, updating, and deleting of data.

The Sql Data Source control supports the same operations, but the approach is different, and this tutorial shows how to configure the Sql Data Source to insert, update, and delete data.

To illustrate this, let s take an example from the table and a Grid View that renders this data.