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.
For now, leave this checkbox unchecked; we'll examine optimistic concurrency with the Sql Data Source control in the next tutorial.
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.Recall that to support inserting, updating, and deleting, with the Object Data Source we needed to specify the object layer methods to invoke to perform the insert, update, or delete action.With the Sql Data Source, we need to provide SQL statements (or stored procedures) to execute.As Figure 4 shows, when the page is visited through a browser a Delete button is included. Figure 4: Each Grid View Row Now Includes a Delete Button (Click to view full-size image) Upon clicking a Delete button, a postback occurs, the Grid View assigns the Figure 5 depicts this interaction graphically.Refer back to the Examining the Events Associated with Inserting, Updating, and Deleting tutorial for a more detailed discussion on the chain of events associated with inserting, updating, and deleting from a data Web control.Find Control(“lblproduct Id”); So whole code is just two line. Below I write whole code Grid View Row row = (Grid View Row)(((Link Button)e. To illustrate this, let s take an example from the table and a Grid View that renders this data.Our goal is to extend this example to allow for the user to delete products via the Grid View.If you need to brush up on implementing these features within the Grid View, Details View, and Form View, return to the Editing, Inserting, and Deleting Data tutorials, starting with An Overview of Inserting, Updating, and Deleting.collection and can include hard-coded values, common parameter source values (querystring fields, session variables, Web control values, and so on), or can be programmatically assigned.