Hi,
Your query seems to be perfect. Just try using this:
protected void DeleteRecord(object sender, GridViewDeleteEventArgs e)
{
string id = gridRegistrationTableDetails.Rows[e.RowIndex].Cells[0].Text;
deleterecordMethod(id);
BindData();
}
private void deleterecordMethod(string id)
{
try
{
SqlConObject.Open();
SqlCommand cmd = new SqlCommand("delete from SignUp where Employee_ID=@EmpID", SqlConObject);
cmd.Parameters.AddWithValue("@EmpID", id);
cmd.ExecuteNonQuery();
}
catch(Exception e)
{
Response.Write("<script>alert('Exception Occurred')</script>"+e);
}
finally
{
SqlConObject.Close();
}
}
Let me know if it helps you..
--Amit