Gridview updating database
For example, to let a visitor edit a database record you first need to let them choose which record to edit.Once they've selected this record, you need to show it's existing values in editable fields (textboxes, cehckboxes, and so on), let the user make any modifications, and then save them.These controls allow page developers to declaratively access and modify data without writing any code to perform the data access. In this article we will examine basics of using the Sql Data Source and Grid View controls to update records from a database.This article is one in a series of articles on ASP. In particular, we look at enabling editing support in the Grid View. This article focuses on the Sql Data Source control; for a detailed look at updating with the Object Data Source, refer to the "Editing, Inserting, and Deleting" tutorials in my Working with Data in ASP. Let's explore the updating "action" for the Access Data Source and Sql Data Source controls in more detail.
When editing with a Grid View we'll specified (as our's does), then the Grid View's smart tag will include a checkbox titled "Enable Editing." Check this checkbox to enable editing.
Checking "Enable Editing" adds a Command Field with its property set to True. When the visitor clicks the Edit button that row becomes editable.
The Edit button disappears and in its place Update and Cancel buttons appear.
Regardless of what workflow is initiated, they all follow the same six steps: the firing of the appropriate pre-action event (, in the case of the updating workflow).
When we examined inserting data and deleting data we looked at doing so both through manually-created Web Forms and through data Web controls, like the Grid View or Details View.