title: Reference data in SQLDataReader by column and rows or any alternative
body: <p>I am running a stored procedure and the result is this format</p>
  
  <pre><code>+------+--------+-----+-------+
  |  ID  | Resign | Sum | Count |
  +------+--------+-----+-------+
  | 1234 |      0 | 400 |     3 |
  | 1234 |      1 | 800 |     4 |
  +------+--------+-----+-------+
  </code></pre>
  
  <p>I tried this code to reference the values returned by the query but, it seem not working the way I want it</p>
  
  <pre><code>if (conn.State != ConnectionState.Open)
      conn.Open();
      SqlCommand sc = new SqlCommand();
      sc.CommandText = "usp_GetResignPool";
      sc.CommandType = CommandType.StoredProcedure;
      sc.Connection = conn;
      sc.Parameters.Add(AddParam(EndDate, "@EndDate"));
      sc.Parameters.Add(AddParam(am_id, "@id"));
  
      SqlDataReader reader;
      reader = sc.ExecuteReader();
  
   while (reader.Read())
              {
                  if reader. // lost here
              }
  </code></pre>
  
  <h2><strong>How can I do something like this. &darr;</strong></h2>
  
  <pre><code>int resigned = 0, resign_count = 0, not_resigned = 0, notresign_count =0;
  
  if (read["Resigned"] == 1)
  {
      resigned = read["sum"];
      resign_count = read["count"];
  }
  else
  {
      not_resigned = read["sum"];
      notresign_count = read["count"]; 
  }           
  </code></pre>
  
  <p>It is not important that I used SQLDataReader.</p>
  
  <p>Edit: Real column names</p>
  
  <pre><code>ID        Resigned    sum                    count
  --------- ----------- ---------------------- -----------
  </code></pre>