Here i also added another Button which Command Name is Empty New.
Since we supplied Edit, Update, Cancel, & Delete command Command Name property to Edit, Update, Cancel, & Delete respectively into the Grid View declaration to cooperate with Sql Data Source to enable users to Update and Delete data without any further implementation. This is because we are using Footer Template for our Insert operation.
These controls allow page developers to declaratively access and modify data without writing any code to perform the data access. These controls allow for a declarative approach to working with data, without needing to write any cumbersome data access code.
This article is one in a series of articles on ASP. The articles we have explored in the series thus far have focused on understanding the core concepts of the data source controls and how to retrieve data from the database.
Now Inserting Data Using Grid View Footer: It requires few tricks to implement.
First we need to modify our Grid View code (make all columns as template column & add a new row into the Grid View Footer for insert) like: Where each column implemented under Template Column. Open the web.config file and add your connectionstring: Now add a Sql Data Source control. For this example this should be: Now add a Grid View in your page. Set the Data Source plus check Enable Paging, Enable Sorting, Enable Editing & Enable Deleting like below: Now the code of the Grid View looks like below: Now run the project. " End Sub End Class Update Command has some parameters and you have not written any code to apply values for those parameters.In my previous article, I described how to use a Grid View control to display data using a Sql Data Source control. Sql Parameter("Contact No", Sql Db Type.[Char], 6) Private Last Delivery As New System. So add below code for the Sql Data Source Inserting Event: C# Code: Protected Sub Sql Data Source1_Inserting(sender As Object, e As System.