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.
Unfortunately, activation email could not send to your email. Please try again.

How to update the Database while performing CRUD Operation

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.

C#

 

VB

 

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.

C#

 

VB

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework: Product Version:
2380 07/15/2014 08/06/2014 ASP.NET Web Forms (Classic) GridGroupingControl 4.5 12.1.0.43
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.