private void MDIInicio_Load(object sender, EventArgs e)
        {
            frmDataBases ventana = new frmDataBases();

            ventana.MdiParent = this;
            //ventana.Show(lista);
            //MessageBox.Show()
        }
Exemple #2
0
 private void btnEntrar_Click(object sender, EventArgs e)
 {
     user     = txtUsuario.Text;
     pwd      = txtPwd.Text;
     puerto   = txtPuerto.Text;
     host     = txtHost.Text;
     server   = cbxConexion.Text;
     database = txtBaseDeDatos.Text;
     if (cbxConexion.SelectedIndex == 0)
     {
         libm = new MySql(txtHost.Text, txtPuerto.Text, txtUsuario.Text, txtPwd.Text, txtBaseDeDatos.Text);
         if (libm.AbrirConexion())
         {
             index = cbxConexion.SelectedIndex;
             frmDataBases ventana = new frmDataBases(index);
             this.Hide();
             ventana.ShowDialog();
         }
         else
         {
             MessageBox.Show("Error: " + libm.errorMsge, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
         }
         libm.CerrarConexion();
     }
     else if (cbxConexion.SelectedIndex == 3)
     {
         PostgresSql libp = new PostgresSql(txtHost.Text, txtUsuario.Text, txtPwd.Text, txtBaseDeDatos.Text);
         if (libp.OpenConnection())
         {
             index = cbxConexion.SelectedIndex;
             frmDataBases ventana = new frmDataBases(index);
             Hide();
             ventana.ShowDialog();
             //Show();
         }
         else
         {
             MessageBox.Show(PostgresSql.errorMsge);
         }
     }
 }