We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to update the Database while performing CRUD Operation

Platform: ASP.NET Web Forms (Classic) |
Control: GridGroupingControl |
.NET Framework: 4.5 |
Product Version:

How to update the Database while performing CRUD Operation

You can update the changes to the database that are done in Grid using the following events.

  • DataSourceControlRowAdding – To add a new Row
  • DataSourceControlRowUpdating - To Update an existing Row
  • DataSourceControlRowDeleting – To delete the Current Row

You can use C# or VB code to perform CRUD operations with Grid as follows. Here, SQL query is used to update the database. You can perform update, insert and delete operation in the Grid. While performing these operations, the corresponding event is invoked. In that event SQL query is used to update the database.

Steps to update the database:


Step - 1 Declaring Events

The events for performing CRUD operation are declared. Refer the following code example in C# and VB to declare the events.





Step-2 Define an Event

SQL queries are used to update the database that is used inside these events. In the RowAdding event, insert query is used to add a new record to the database. Update query is used in RowUpdate event to update the existing record in the database. In the RowDeleting event, Delete query is used to remove the selected record from the database.

Please refer the following C# and VB code example to update the changed data in the database.




You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile