Hi,
Have you create update and Delete parameters. Have you pass dataKeyNames ? As you have ID in your table so DataKeyNames must be ID. Please refer following code.
In code, you can see parameters for update and delete like
<UpdateParameters>
<asp:Parameter Name="Mobile" />
<asp:Parameter Name="Email" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="EmpID" />
</DeleteParameters>
Full Code as below
<html>
<head>
<title>GridView Edit and Delete Row</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView
ID="GridView1" Font-Names="Arial" Font-Size="Smaller"
AutoGenerateColumns="False"
AutoGenerateEditButton="True"
AutoGenerateDeleteButton="False"
DataSourceID="SqlDataSource1"
DataKeyNames="EmpID"
runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<%----%>
<asp:LinkButton Runat="server"
OnClientClick ="return confirm('Are you sure you?');"
CommandName="Delete">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<%----%>
<asp:BoundField DataField="EmpID" HeaderText="EmpID"
SortExpression="EmpID" ReadOnly="true" />
<asp:BoundField DataField="EmpName" HeaderText="EmpName"
SortExpression="EmpName" ReadOnly="true" />
<asp:BoundField DataField="Mobile" HeaderText="Mobile"
SortExpression="Mobile" />
<asp:BoundField DataField="Email" HeaderText="Email"
SortExpression="Email" />
</Columns>
</asp:GridView>
<%----%>
<asp:SqlDataSource
ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:DNA_CLASSIFIEDConnectionString %>"
SelectCommand="SELECT [EmpID], [EmpName], [Mobile], [Email] FROM [EmployeeDetails]"
UpdateCommand="UPDATE EmployeeDetails SET Mobile = @Mobile, Email = @Email
WHERE EmpID = @EmpID"
DeleteCommand="DELETE FROM EmployeeDetails WHERE EmpID = @EmpID">
<UpdateParameters>
<asp:Parameter Name="Mobile" />
<asp:Parameter Name="Email" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="EmpID" />
</DeleteParameters>
</asp:SqlDataSource>
</div>
</form>
</body>
</html>
Please refer link(
GridView Edit, Update and Delete Example - Simple GridView Example with Row Edit and Delete Options - C# and Vb.Net[
^]) for detail knowledge.