gridview have a problem
protected void DeleteRowButton_Click(Object sender, GridViewDeleteEventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionAkaryakit"].ConnectionString);
con.Open();
int i = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value);
string str1 = "DELETE FROM dbo.Urun_Satis where Musteri_Bilgisi=" + i + "";
SqlCommand cmd = new SqlCommand(str1, con);
cmd.ExecuteNonQuery();
con.Close();
}
The directory was out of range. It should not be a negative value and should be smaller than the size of the collection. \ R \ nParameter name: index "}