private void button2_Click(object sender, EventArgs e) { MySqlConnection conectar = new MySqlConnection("server=127.0.0.1;database=proyecto;Uid=root;"); conectar.Open(); MySqlCommand codigo = new MySqlCommand(); MySqlConnection conectanos = new MySqlConnection(); codigo.Connection = conectar; codigo.CommandText = ("select * from usuarios where matricula ='" + textBoxusuario.Text + "' and pass= '******'"); MySqlDataReader leer = codigo.ExecuteReader(); if (leer.Read()) { MessageBox.Show("Bienvenido tutor"); INICIO_SESION_TUTOR llamar = new INICIO_SESION_TUTOR(); llamar.Show(); this.Hide(); } else { MessageBox.Show("Usuario incorrecto"); } conectar.Close(); }
private void button2_Click(object sender, EventArgs e) { //CREAMOS LA INSTANCIA DEL FORMULARIO INICIO_SESION_TUTOR obj = new INICIO_SESION_TUTOR(); //LLAMAMOS EL OBJETO Y LO PONEMOS VISIBLE obj.Visible = true; //OCULTAMOS Visible = false; }