private void btn_delete_Click(object sender, EventArgs e) { int id = Int32.Parse(dataGridView1.CurrentRow.Cells[0].Value.ToString()); DBtest del = DBtest.GetDataID(id); del.Delete(); display(); }
private void btn_update_Click(object sender, EventArgs e) { //edit record int id = Int32.Parse(dataGridView1.CurrentRow.Cells[0].Value.ToString()); DBtest rec = DBtest.GetDataID(id); rec.Firstname = txt_fname.Text; rec.Middlename = txt_lname.Text; rec.Lastname = txt_mname.Text; rec.Update(); MessageBox.Show("Updated Successfully"); display(); }