Esempio n. 1
0
        private void BtnDbSave_Click(object sender, EventArgs e)
        {
            /*INI READ AND SAVE CONNECTION PARAMETERS*/
            conParams.Hostaname = textHost.Text;
            conParams.User      = textUser.Text;
            conParams.Password  = textPass.Text;
            conParams.Dbname    = textDb.Text;
            /*END READ AND SAVE CONNECTION PARAMETERS*/

            /*Save params values */
            conParams.SetValueOnFile();


            //Test BD CONNETION
            DbConnetion dbConn = new DbConnetion();

            /*Abre conexion para test*/
            dbConn.StartConn();

            if (dbConn.StartConn().State == System.Data.ConnectionState.Open)
            {
                MessageBox.Show("Test de conexión exitoso", "Test de conexión");
                this.Close();
            }
        }