private void btReturn_Click(object sender, EventArgs e) { FormMenuAdmin formMenuAdmin = new FormMenuAdmin(); formMenuAdmin.Show(); this.Close(); }
private void btJoinAdmin_Click(object sender, EventArgs e) { int admin = 0; MySqlConnection conectaradmin = new MySqlConnection("server=localhost; database=login; UID=root; password=;"); conectaradmin.Open(); MySqlCommand codigo = new MySqlCommand(); MySqlConnection conectanos = new MySqlConnection(); codigo.Connection = conectaradmin; codigo.CommandText = ("Select *from logindatos where nombre ='" + tbNickAdmin.Text + "'and contraseña = '" + tbPassAdmin.Text + "' and tipo = '" + admin + "'"); MySqlDataReader leer = codigo.ExecuteReader(); if (leer.Read()) { MessageBox.Show("bienvenido"); Form register = new FormMenuAdmin(); register.Show(); this.Hide(); } else { MessageBox.Show("error"); } conectaradmin.Close(); }