title: SqlDataReader doesn't show return rows even when stored procedure does
body: <p>I am trying to get data using a <code>SqlDataReader</code>. When I look at the result, I do see the number of columns but rows are missing and I am seeing only blanks with "the enumeration yielded no results". </p>
  
  <p>After spending much time and going through similar issues on the net I couldn't resolve my issue. Then I tried the same stored procedure but used the DataAdapter. Using a <code>DataAdapter</code>, all the rows were returned. I am not sure what is causing the issue. I tried to rewrite my methods differently but no avail. </p>
  
  <pre><code>public static SqlDataReader ExecuteDataReader(string connection, string storedProcedure)  
  {       
      using (var sqlCon = new SqlConnection(connection))
      {
          //  sqlCon.Open();
          var cmd = new SqlCommand(storedProcedure, sqlCon)
              {
                  CommandType = CommandType.StoredProcedure
              };
  
  
          sqlCon.Open();
  
          using (var reader = cmd.ExecuteReader())
          {
              var count = reader.FieldCount;
  
              while (reader.Read())
              {
                      for (var i = 0; i &lt; count; i++)
                      {
                          Console.WriteLine(reader.GetValue(i));
                      }
              }
          }
  
          //reader.Close();
          return null;  // for testing purpose
      }
  }
  </code></pre>
  
  <p>--stored procedure.  (kept it simple)</p>
  
  <pre><code>Create PROC [dbo].GetTheData  
  
  As   
  
  select     '1' AS one,'2' as two,'3' as three,'4' as four,'5'as five
  </code></pre>