There are many method to make connection between sql server and application.
This gridview example we are using dataset and stored procedure method for connectivity.
After you have run the website, you will see the Grid View showing details of employees in tabular format.
We have selected four columns from Employee Details table.
In this tutorial I will show you how you can create an editable Grid View control for administrators to modify database records directly into the Grid View control.
Editing the Grid View control can be an incredibly easy feature to add for certain database tables, especially those who have no foreign key associated and can easily be edited through the use of a standard Text Box web control as shown in the figure below: Before we start examining the ASP.
Data Bind() End Sub Protected Sub Grid View1_Row Deleting(By Val sender As Object, By Val e As Grid View Delete Event Args) Dim idd As Integer = Convert.
NET Grid View markup and associated code lets first enumerate the important code pieces of this tutorial.
In the above code, I set two properties Show Edit Button and Show Cancel Button of Command Field.
Next event is the Grid View Row Editing event to give ASP. You need to set the Edit Index property of the Grid View with the New Edit Index property of the Grid View Edit Event Args class.
If user clicks the Cancel button while Grid View is in editing mode, you need to Cancel the Editing process and also need to reset the Edit Index property to -1 in the Row Canceling Edit event of the Grid View control as shown below: The last step is to handle the Row Updating event to actually update the back end database.