private void btnRegresar_Click(object sender, EventArgs e) { WinnerPet Principal = new WinnerPet(); Principal.Show(); this.Close(); }
private void btnLogin_Click(object sender, EventArgs e) { guardarUsuario = txtUser.Text; try { cn = new SqlConnection("Data Source=localhost;Initial Catalog=WinnerPet;Persist Security Info=True;User ID='" + txtUser.Text + "';Password='******'"); cn.Open(); WinnerPet principal = new WinnerPet(); this.Visible = false; principal.Show(); } catch (Exception ex) { MessageBox.Show("No se conecto con la base de datos: " + ex.ToString()); } }