title: Login windows forms c#
body: <p>I have employees SQL DB and in the DB I have user table that contain Sid and password.</p>
  
  <p>I want to verify the enter details is correct and if it the user can enter to the system.</p>
  
  <p>Here is my start code for the verifying and it's not working:</p>
  
  <pre><code>public void confirm(string name, string pass)
  {
      string connection_sting = @"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Senan\Documents\employees.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True";
      using (SqlConnection cnn = new SqlConnection(connection_sting)) 
      {
          cnn.Open();
  
          using (SqlCommand cmd = new SqlCommand("select * from employees where name=@Sid and pass=@password" , cnn))
          {
              SqlDataReader reader;
              reader = cmd.ExecuteReader();
  
              if (reader.HasRows)
                  MessageBox.Show("pass");
              else
                  MessageBox.Show("fail");
          }
      }
  </code></pre>