for (int i = 0; i < dataGridView1.Rows.Count; i++) { DataGridViewRow dr = dataGridView1.Rows[i]; if (dr.Selected == true) { dataGridView1.Rows.RemoveAt(i); try { SqlCommand cmd = new SqlCommand("Delete from calender where ID= ' " + i + "'", con); cmd.ExecuteNonQuery(); con.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }
SqlCommand cmd = new SqlCommand("Delete from calender where ID= '" + i + "'", con);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)