private void toolStripButton1_Click_1(object sender, EventArgs e) { Buscar2 o = new Buscar2(); o.MdiParent = this; o.Show(); }
private void excluirToolStripMenuItem_Click(object sender, EventArgs e) { try { String ID; ID = dgAgendamento.SelectedCells[0].Value.ToString(); String SQL = "Delete from Agendamento where Cod_Agendamento=" + ID; String StrConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "\\MovvHair.mdb;"; OleDbConnection Conn = new OleDbConnection(StrConn); Conn.Open(); OleDbCommand Cmd = new OleDbCommand(SQL, Conn); Cmd.ExecuteNonQuery(); Conn.Close(); this.Hide(); Buscar2 o = new Buscar2(); o.Show(); } catch (Exception Erro) { MessageBox.Show(Erro.Message); } }