if (e.ColumnIndex == dataGridView.Columns["Delete"].Index && e.RowIndex >= 0)
{
//dataGridView.Rows.RemoveAt(e.RowIndex);
int i = 1; con.Open();
SqlCommand cmd = new SqlCommand("delete from MainBillForm where Billno=" + Convert.ToInt16(dataGridView.Rows[e.RowIndex].Cells[1].Value), con);
int count = cmd.ExecuteNonQuery();
if (count > 0)
{
MessageBox.Show("Record Deleted Successfully!");
}
dataGridView.DataSource = null;
displayDataGridView();
}

Rafnas T PPosted May 15, 2017, 6:07 AM
Jyoti JodhaPosted May 15, 2017, 6:04 AM
Rafnas T PPosted May 15, 2017, 5:36 AM
Sameer ShaikPosted May 15, 2017, 5:25 AM
ketan borsdiyaPosted May 15, 2017, 5:16 AM
Karthi KeyanPosted May 15, 2017, 5:13 AM
Rafnas T PPosted May 15, 2017, 4:31 AM