title: ExecuteReader returns no results, when inspected query does
body: <p>Consider the following code:</p>
  
  <pre><code>        StringBuilder textResults = new StringBuilder();
          using(SqlConnection connection = new SqlConnection(GetEntityConnectionString()))
          {
              connection.Open();
              m.Connection = connection;
              SqlDataReader results = m.ExecuteReader();
              while (results.Read())
              {
                  textResults.Append(String.Format("{0}", results[0]));
              }
          }
  </code></pre>
  
  <p>I used Activity Monitor within Sql Server Mgmt Studio on the database to inspect the exact query that was being sent.  I then copied that query text to a query editor window within SSMS, and the query returned the expected results.  However, <code>SqlDataReader results</code> is always empty, indicating "The enumeration returned no results."</p>
  
  <p>My suspicion is that somehow the results are not being returned correctly, which makes me think there's something wrong with the code above, and not the query itself being passed.</p>
  
  <p>Is there anything that would cause this in the code above?  Or something I've overlooked?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Here is the query as indicated by the SQLCommand object:</p>
  
  <pre><code>SELECT DISTINCT StandardId,Number 
  FROM vStandardsAndRequirements 
  WHERE StandardId IN ('@param1','@param2','@param3') 
  ORDER BY StandardId
  </code></pre>
  
  <p>Here is the query as it appears in Activity Monitor:</p>
  
  <pre><code>SELECT DISTINCT StandardId,Number 
  FROM vStandardsAndRequirements 
  WHERE StandardId IN ('ABC-001-0','ABC-001-0.1','ABC-001-0') 
  ORDER BY StandardId
  </code></pre>
  
  <p>The query is working against a single view.</p>
  
  <p>When I ran the second query against the database, it returned 3 rows.</p>
  
  <p>The SqlDataReader indicates 0 rows.</p>