protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
int id = Convert.ToInt16(GridView1.DataKeys[e.NewEditIndex].Values[0].ToString());
cnn.Open();
SqlCommand cmd = new SqlCommand("delete from call_details where id=" + id, cnn);
int result = cmd.ExecuteNonQuery();
cnn.Close();
GridView1.DataBind();
this code will give me error like:Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
i have not use template field.then what is solution.