title: Login Code works for admin and user , but did not show error when login with wrong id or pass
body: <p>I am creating a program for my final project , i have set-up a database , everything works fine , but the only thing i couldn't finish is the Login system.</p>
  
  <p>Both Users and admin will log through the same form.</p>
  
  <p>When i enter an admin id , it will login and say "hello admin" , and user the same.
  but when i enter a non-existent id , it wouldn't show the error..</p>
  
  <p>here's my code - </p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
  try
  {
      string userNameText = txtUser.Text;
      string passwordText = txtPass.Text;
      string isAdmin = "yes";
      string isNotAdmin = "no";
      if (!(string.IsNullOrEmpty(txtUser.Text)) &amp;&amp; !(string.IsNullOrEmpty(txtPass.Text)))
      {
          SqlConnection SCScon = new SqlConnection();
          SCScon.ConnectionString = "Data Source=PEWPEWDIEPIE\\SQLEXPRESS;Initial Catalog=master;Integrated Security=True";
          SqlCommand cmd = new SqlCommand("SELECT ISNULL(SCSID, '') AS SCSID, ISNULL(SCSPass,'') AS SCSPass, ISNULL(isAdmin,'') AS isAdmin FROM SCSID WHERE SCSID='" + txtUser.Text + "' and SCSPass='" + txtPass.Text + "'", SCScon);
          SCScon.Open();
          SqlDataReader dr = cmd.ExecuteReader();
          while (dr.Read())
                  {
                      if (this.CompareStrings(dr["SCSID"].ToString(), txtUser.Text) &amp;&amp;
                          this.CompareStrings(dr["SCSPass"].ToString(), txtPass.Text) &amp;&amp;
                          this.CompareStrings(dr["isAdmin"].ToString(), isAdmin))
                      {
                          MessageBox.Show("Hello " +txtUser.Text , "Admin" , MessageBoxButtons.OK , MessageBoxIcon.Information);
                          _Adminform.Show();
                          this.Hide();
                      }
                      else if (this.CompareStrings(dr["SCSID"].ToString(), txtUser.Text) &amp;&amp;
                          this.CompareStrings(dr["SCSPass"].ToString(), txtPass.Text) &amp;&amp;
                          this.CompareStrings(dr["isAdmin"].ToString(), isNotAdmin))
                      {
                          MessageBox.Show("Welcome " + txtUser.Text , "User");
                          _userform.Show();
                          this.Hide();
  
                      }
                      else
                      {
                          MessageBox.Show("Wrong ID/Pass");
                      }
  
                  }'
      }
  }
  catch (Exception ex)
          {
              MessageBox.Show("error2" + ex);
          }
  </code></pre>
  
  <p>}</p>