Exemplo n.º 1
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            string Servidor = txtServidor.Text;
            string Port     = txtPorta.Text;
            string User     = txtUser.Text;
            string Banco    = txtBanco.Text;
            string Senha    = txtSenha.Text;

            try
            {
                CG.ConfigConexao(Servidor, Port, User, Banco, Senha);
                CG.ConectarBancoDeDados();
                Close();
            }
            catch
            {
                MessageBox.Show("Não foi possivel conectar ao banco");
            }
        }