private void btn_cancel_ticket_Click(object sender, EventArgs e) { string sql = null, member = null, P_id; methods m = new methods(); sql = "select Ticket.P_id from Ticket where Ticket.T_id='" + textBox_ticket_no.Text + "' "; member = "P_id"; P_id = m.id_sender(sql, member); sql = "DELETE FROM Ticket WHERE Ticket.T_id='" + textBox_ticket_no.Text + "'"; m.delete_row(sql); sql = "DELETE FROM Passenger WHERE P_id='" + P_id + "'"; m.delete_row(sql); MessageBox.Show("Ticket Cancled"); }