In this article I will show you that how you can validate the controls which are inside the Grid View control.
For this I will make the editable Grid View and use the Required Field Validator for the Text Boxes.
In this article we will look at how to update or delete a record in a database table using a Grid View control.
The Grid View control is a tabular databound control but sometimes it is used like a spreadsheet control. NET 2.0 and is an improved version of the Data Grid control. We can use this to display data from a database and edit, sort and select the data.
Delete a Record We can delete a record from the database table by clicking on the delete button that is in the Delete column of the Grid View.
We first of all create a Stored Procedure that gets the Id of an employee as a parameter from the Grid View on whichever row the user clicked. In this event, first we get the datakey value that is the id of an employee of whichever row the user clicked and that id is passed as a parameter to the Stored Procedure. According to the above, in these three operations we use three events of the Grid View for each operation.
aspdotnet-suresh offers C#articles and tutorials,csharp dot net,articles and tutorials, VB.Now you can specify the columns that you want in your Grid View.You can use both "Bound Fields" & "Template Fields" now. Create SQL Connection We need a connection with a Microsoft SQL Server database so we can access data and perform an operation on it.We define a connection in the web.config file and give a name to the connection string.