title: Why am I getting 'Invalid attempt to read when no data is present' here?
body: <p>My stored procedure is the simple one-liner</p>
  
  <pre><code>CREATE PROCEDURE CheckIfFinished    
      @pid UNIQUEIDENTIFIER 
  AS  
  BEGIN
      SELECT finished 
      FROM Partners 
      WHERE id = @pid   
  END  
  </code></pre>
  
  <p>and I'm calling it from my C# code like </p>
  
  <pre><code>using (SqlCommand cmd = new SqlCommand("CheckIfFinished", this._Conn))
  {
      cmd.CommandType = CommandType.StoredProcedure;
      cmd.Parameters.AddWithValue("@pid", pid);
  
      this._Conn.Open();
  
      using (SqlDataReader dataReader = cmd.ExecuteReader())
      {
          finished = dataReader.GetByte(0) == 1 ? true : false;
      }
  
      this._Conn.Close();
  }
  </code></pre>
  
  <p>The column <code>finished</code> in the <code>Partners</code> table is of type <code>TINYINT NOT NULL DEFAULT 0</code></p>
  
  <p>Stack trace of error is</p>
  
  <blockquote>
    <p>[InvalidOperationException: Invalid attempt to read when no data is
    present.]<br>
    System.Data.SqlClient.SqlDataReader.CheckDataIsReady(Int32
    columnIndex, Boolean allowPartiallyReadColumn, Boolean permitAsync,
    String methodName) +6531242<br>
    System.Data.SqlClient.SqlDataReader.TryReadColumn(Int32 i, Boolean
    setTimeout, Boolean allowPartiallyReadColumn) +81<br>
    System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean
    setTimeout, Boolean allowPartiallyReadColumn) +25<br>
    System.Data.SqlClient.SqlDataReader.GetByte(Int32 i) +27<br>
    Survey.Models.SurveyDbModel.CheckIfFinished(Guid pid) +230</p>
  </blockquote>
  
  <p>Where am I going wrong here?</p>