I have a gridview with bound fields populated from a SQL table.

I need the ability to delete a row from the datagrid and from the SQL table

I have added a <asp:CommandField ShowDeleteButton="True" ButtonType="Button"/> to the datagrid

But don't know how to action this in the code (VB.Net)

Could someone give me a clue or an example that Icould follow??

Many thanks in advanced.


<asp:GridView ID="grdReportResults" runat="server" AutoGenerateColumns="False" BackColor="White" CellPadding="0" Font-Names="Verdana" Font-Size="x-Small" Width="700px">
<HeaderStyle BackColor="Maroon" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#c0c0c0"/>
<asp:BoundField DataField="EmployeeID" HeaderText="Employee ID " />
<asp:BoundField DataField="Date Of PDR" HeaderText="PDR Date " />
<asp:BoundField DataField="Six Month Review Date" HeaderText="Six Monthly Review Date " />
<asp:BoundField DataField="Training Type" HeaderText="Type of Training " />
<asp:BoundField DataField="Name Of Course" HeaderText="Course Name " />
<asp:BoundField DataField="Qualification Obtained" HeaderText="Qualification Obtained " />
<asp:BoundField DataField="Start Date" HeaderText="Course Start Date " />
<asp:BoundField DataField="End Date" HeaderText="Course End Date " />
<asp:BoundField DataField="Number Of Days" HeaderText="Number of Days " />
<asp:CommandField ShowDeleteButton="True" ButtonType="Button"/>

Private Sub grdReportResults_RowDeleted(sender As Object, e As GridViewDeletedEventArgs) Handles grdReportResults.RowDeleted

End Sub