private void button1_Click(object sender, EventArgs e) { UsuarioTableAdapter login = new UsuarioTableAdapter(); DataTable UsuarioLogin; UsuarioLogin = login.Login(TxtUsuario.Text, TxtSenha.Text); if (UsuarioLogin.Rows.Count > 0) { if (tela == 1) { AdmForm adm = new AdmForm(); adm.Visible = true; this.Visible = false; } else { secondform novo = new secondform(); novo.Show(this); this.Visible = false; } } if (UsuarioLogin.Rows.Count == 0) { MessageBox.Show("Usuario ou Senha incorretos"); } }