private void button2_Click(object sender, EventArgs e) { this.Hide(); Form21 f21 = new Form21(); f21.ShowDialog(); }
private void button1_Click(object sender, EventArgs e) { string myconnection = "Data Source=DESKTOP-9J170IF;Initial Catalog=Final_Project;Integrated Security=True"; SqlConnection myconn = new SqlConnection(myconnection); string query = "Delete from Services where serviceID ='" + this.textBox1.Text + "';"; SqlCommand cmd = new SqlCommand(query, myconn); SqlDataReader myreader; try { myconn.Open(); myreader = cmd.ExecuteReader(); MessageBox.Show("Deleted"); this.Hide(); Form21 f21 = new Form21(); f21.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }