SqlDataSource in ASP.Net

SqlDataSource Control in ASP.Net

SqlDataSource is intended to replace the ADO.NET code you would normally write in a page to create a connection and command to query a database. Because the data queries are specified directly as properties of the data source control, this is sometimes called a two-tier model, because the data queries are still maintained in page code.

RowCancelingEdit event is used to cancel edit mode.

The zero-based index of the row to edit. EditIndex = -1, which indicates that no row is being edited.

Add , updateand Delete data in GridView using SqlDataSource

The RowCommand event is raised whenever any button associated with a row in the GridView is clicked. This provides for programmatically determining which specific command button is clicked and take appropriate action.