title: Foreach SQLDataReader
body: <p>I have an page that list rows from my DB table, with User Name and an CheckBox.
  I need an function that send email to User when CheckBox.checked is true, but don't show Email in my page.
  I have these mothods:</p>
  
  <pre><code>public class ListRequest
  {
      public string UserName { get; set; }
      public string Email { get; set; }
  }
  
  public List&lt;ListRequest&gt; PreencheValores(SqlDataReader reader)
  {
      var lista = new List&lt;ListRequest&gt;();
      while (reader.Read())
      {
          var listRequest = new ListRequest();
          listRequest.UserName = reader["User"].ToString();
          listRequest.Email = reader["Email"].ToString();
          lista.Add(listRequest);
      }
      return lista;
  }
  
  public List&lt;ListRequest&gt; ConsultarRequest()
  {
      var lstRetorno = new List&lt;ListRequest&gt;();
      using (objConexao = new SqlConnection(strStringConexao))
      {
          using (objCommand = new SqlCommand(strSelectPorID, objConexao))
          {
              try
              {
                  objConexao.Open();
                  objCommand.Parameters.AddWithValue("@UserName", dm3);
  
                  var objDataReader = objCommand.ExecuteReader();
                  if (objDataReader.HasRows)
                      lstRetorno = PreencheValores(objDataReader);
              }
              catch (Exception ex)
              {
                  throw new Exception(ex.Message);
              }
              finally
              {
                  objConexao.Close();
              }
          }
      }
      return lstRetorno;
  }
  </code></pre>
  
  <p>How I can make foreach for this?? I need get all string Email to this list but don't show Email in my page.
  now I use foreach (GridViewRow row in GridView.Rows) to get name when CheckBox.cheked is true.
  I'm clear in question?
  Tks!</p>