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 delete data from a Grid View that is populated by means of an Object Data Source, however, the underlying data access layer class must provide a method for deleting the data.
In this section we'll see how to delete data from a Grid View that utilizes both a Sql Data Source and an Object Data Source.
this error display when i update the record i want to update the record by datagridview by depend on the id .
All of the examples we've seen thus far have been read-only Grid Views.
Instead of assuming what the indexes are just find the control using the Grid View Row you already located.
The first control of that cell is not your textbox hence the cast fail.
Alternatively, the Sql Data Source can be used in place of the Object Data Source.The Grid View allows editing on a row-by-row basis.An editable Grid View contains an additional column with an Edit button in each row. In addition to deleting a Grid View's underlying data, another common need is to allow end users to edit the data displayed in a Grid View. NET 1.x's Data Grid control, editing the data is certainly possible, but requires creating three event handlers and writing a dozen or so lines of code. NET 2.0, it is possible to create an editable Grid View without writing a single line of code!All of the necessary functionality is encapsulated within the Grid View.