private void DeleteData_Click(object sender, EventArgs e) { deleteData ob = new deleteData(); ob.Show(); this.Hide(); }
private void button2_Click(object sender, EventArgs e) { connection con = new connection(); con.thisConnection.Open(); OracleCommand thisCommand1 = con.thisConnection.CreateCommand(); thisCommand1.CommandText = "delete hospital_login where id= '" + em_id.Text + "'"; thisCommand1.Connection = con.thisConnection; thisCommand1.CommandType = CommandType.Text; OracleCommand thisCommand2 = con.thisConnection.CreateCommand(); thisCommand2.CommandText = "delete salary_account where id= '" + em_id.Text + "'"; thisCommand2.Connection = con.thisConnection; thisCommand2.CommandType = CommandType.Text; OracleCommand thisCommand3 = con.thisConnection.CreateCommand(); thisCommand3.CommandText = "delete doctor_data where doc_id= '" + em_id.Text + "'"; thisCommand3.Connection = con.thisConnection; thisCommand3.CommandType = CommandType.Text; //For Insert Data Into Oracle// try { thisCommand1.ExecuteNonQuery(); thisCommand2.ExecuteNonQuery(); thisCommand3.ExecuteNonQuery(); MessageBox.Show("delete successfully"); this.Hide(); deleteData ob = new deleteData(); ob.Show(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }