try
{
int id = Convert.ToInt32(dataGridView1.CurrentRow.Index.ToString());
cid =Convert.ToInt32( dataGridView1.Rows[id].Cells[0].Value.ToString());
OleDbCommand cmd = new OleDbCommand("delete * from customer where id="+cid+"", con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
gridshow();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
{
int id = Convert.ToInt32(dataGridView1.CurrentRow.Index.ToString());
cid =Convert.ToInt32( dataGridView1.Rows[id].Cells[0].Value.ToString());
OleDbCommand cmd = new OleDbCommand("delete * from customer where id="+cid+"", con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
gridshow();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
No comments:
Post a Comment