I am writing an asp 4.0 web site that will allow the users to add, change, and delete records from certain SQL tables. On one of the pages there is a GridView control with a "Select" link control on each row. When the user clicks the Select control, that row's cells values are filled into some text boxes below the gridview and the user can then add, change, or delete the record.
I have tried using the Add, Change, and Delete features of the gridview control, but do not find them easy for the users. So I am filling in these text boxes below the gridview and allowing the users to make their changes.
With that said, how do I delete a record in a SQL table when the user clicks the Delete button? Once the user clicks the Delete button, the record should be removed from the SQL table and the gridview refreshed.
I am using the VB Code Behind method. Here is the event that is triggered when the user clicks the Delete button:
Protected Sub btnDelete_Click(sender As Object, e As System.EventArgs) Handles btnDelete.Click
(What goes here?)