This example shows how to edit and update records in a Grid View in ASP. This example is helpful in situations where an administrator needs to edit several records from the database.
For demonstration I have created a database (named Database.mdf) in which we have a table named tbl_Employee.
The Grid View control supports the following features:use Row Editing, Row Updating, Row Deleting, Row Command, Row Data Bound, Row Canceling Edit, and Pagination in a Data Grid.
The Data Provider will detect a Parameter declaration discrepancy when Batch Update (Td Data Adapter.
However, Update Command, Insert Command and Delete Command properties can be manually setup as needed or alternatively registered to listen for Row Updating events and to modify the DML generated by the Td Command Builder.
To manually specify columns for the gridview you have to set Auto Generate Columns="false".
Now you can specify the columns that you want in your Grid View.
Then have a seperate function to update the values entered and finally call your Bind Grid() function which again binds the gridview..
Note: I'm using stored procedure to update my DB table.
Introduction The Grid View control displays the values of a data source in a table.
Each column represents a field, while each row represents a record.
Row Updating = new Sql Row Updating Event Handler(da_Row Updating); da.
Row Updated = new Sql Row Updated Event Handler(da_Row Updated); Data Set ds = new Data Set(); // ...
You can use both "Bound Fields" & "Template Fields" now.