Net gridview rowupdating event
Net Grid View control with simple Data Set or Data Table, and also explains the methods like Insert, Edit, Update and Delete function in the Grid View control.You can see most of the articles and tutorials in many websites teach you the way to bind a Grid View control to the database with some Data Source controls such as SQLData Source, Object Data Source, Access Data Source and even XMLDatasource.
However, most of the real world cases call for validating the data being edited or deleted. Drag and drop an SQL Data Source control on the web form.To manually specify columns for the gridview you have to set Auto Generate Columns="false".Now you can specify the columns that you want in your Grid View.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.Then in the code behind I have handled the On Row Command event.
In the event handler function I have checked for the Command Name property and write necessary code for each of the actions.
aspdotnet-suresh offers C#articles and tutorials,csharp dot net,articles and tutorials, VB.
If you like my work; you can appreciate by leaving your comments, hitting Facebook like button, following on Google , Twitter, Linkedin and Pinterest, stumbling my posts on stumble upon and subscribing for receiving free updates directly to your inbox .
Stay tuned and stay connected for more technical updates.
You can find the textbox that is generated on edit event in the Row Updating event below and assign it to a string variable.
In this article we will look at how to update or delete a record in a database table using a Grid View control.