private void mnuDeleteTable_Click(object sender, EventArgs e) { CommandExecutor commandExecutor = new CommandExecutor(); try { if (MessageBox.Show("Are you sure you want to delete this table?", "", MessageBoxButtons.YesNo) == DialogResult.Yes) { // Delete table from database commandExecutor.DeleteTable(treeTables.SelectedNode.Text); // Remove tree node treeTables.Nodes.Remove(treeTables.SelectedNode); } } catch (Exception ex) { DisplayError(ex); } }