Now, delete the Student data shown in the Message box “Student Data Delete Successfully”. If you have any other questions then please provide your comments below.
(For an example of this scenario, see Walkthrough: Using a Data Grid Web Control to Read and Write Data.) Alternatively, you can update the database directly, using SQL statements or stored procedures, which is what this walkthrough illustrates.
I am able to access the database and insert new customer but it doesn't work when i try to update any record. thank you so much this is all my code You have two if statements that check if the query string is empty or null but not one that checks if it isn't.
Therefore, if the query string["ID"] is set to some value nothing will happen.
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.
As discussed in An Overview of Inserting, Updating, and Deleting, the Grid View control provides built-in updating and deleting capabilities, while the Details View and Form View controls include inserting support along with editing and deleting functionality.