示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
            FrmAsesorPrincipal frmAsesorPrincipal = new FrmAsesorPrincipal();

            frmAsesorPrincipal.ShowDialog();
        }
示例#2
0
        private void BtnIngresar_Click_1(object sender, EventArgs e)
        {
            conexion.ConnectionString = "server=localhost; database=check - on; Uid=root; Pwd = ; SslMode=none;";
            conexion.Open();

            MySqlCommand comando = new MySqlCommand();

            comando.Connection = conexion;

            comando.CommandText = "select *from user where IdUser = '******' and Password = '******'";

            MySqlDataReader leer = comando.ExecuteReader();

            if (leer.Read())
            {
                MessageBox.Show("Bienvenido");
                this.Hide();
                FrmAsesorPrincipal frmAsesorPrincipal = new FrmAsesorPrincipal();
                frmAsesorPrincipal.ShowDialog();
            }
            else
            {
                MessageBox.Show("Usuario o contraseña incorrecta");
            }
            conexion.Close();
        }