title: C# - SELECT Query number of rows affected is always -1
body: <p>I have this code and it always returns -1.I have three tables (a picture is more suggestive ):
  <img src="https://i.stack.imgur.com/S7zCw.png" alt="enter image description here"></p>
  
  <p>I want to see if the row is already in the ReservationDetails table, and if it's not to insert it. </p>
  
  <pre><code>try
          {
              SqlConnection conn = new SqlConnection... 
              SqlCommand slct = new SqlCommand("SELECT * FROM ReservationDetails WHERE rID=@rID AND RNumber=@RNumber", conn);
              slct.Parameters.AddWithValue("@rID", (int)comboBox1.SelectedValue);
              slct.Parameters.AddWithValue("@RNumber", dataGridView1.SelectedRows[0].Cells[0].Value);
  
              int noRows;//counts if we already have the entry in the table
              conn.Open();
              noRows = slct.ExecuteNonQuery();
              conn.Close();
              MessageBox.Show("The result of select="+noRows);
  
              if (noRows ==0)    //we can insert the new row
  </code></pre>