title: How to use BeginExecuteReader
body: <p>Good day.</p>
  
  <p>Please, help me about how to use three methods BeginExecuteReader() of SqlCommand class, using Generic Lists. I made a method using BeginExecuteReader, but i don't know if this is the best way of usage</p>
  
  <pre><code>public class Empresa {
      public Empresa() {
          PkEmpresa = -1;
          CodigoEmpresa = "";
          Descripcion = "";
          PkCategoriaEmpresa = -1;
      }
  
      public int PkEmpresa { get; set; }
      public string CodigoEmpresa { get; set; }
      public string Descripcion { get; set; }
      public int PkCategoriaEmpresa { get; set; }
  
      public Empresa ShallowCopy() {
          return (Empresa)this.MemberwiseClone();
      }
  }
  
  
  
  public class AsyncronousDAL {
      private static string getConexion() {
          return "Data Source=DATABASE;Initial Catalog=DATA_BASE;Integrated Security=True;Asynchronous Processing=True";
      }
  
      public static List&lt;Empresa&gt; ConsultaAsincrona() {
          List&lt;Empresa&gt; _resultados = new List&lt;Empresa&gt;();
  
          using (SqlConnection conexion = new SqlConnection(getConexion())) {
              using (SqlCommand commando = new SqlCommand("[dbo].[pruebaAsync]", conexion)) {
                  commando.CommandType = System.Data.CommandType.StoredProcedure;
                  conexion.Open();
                  IAsyncResult resultado = commando.BeginExecuteReader();
                  using (SqlDataReader reader = commando.EndExecuteReader(resultado)) {
                      while (reader.Read()) {
                          _resultados.Add(new Empresa() {
                              PkEmpresa = Convert.ToInt32(reader["PkEmpresa"]),
                              CodigoEmpresa = reader["CodigoEmpresa"].ToString(),
                              Descripcion = reader["Descripcion"].ToString(),
                              PkCategoriaEmpresa = Convert.ToInt32(reader["PkCategoriaEmpresa"])
                          });
                      }
                  }
              }
          }
  
          return _resultados;
      }
  }
  </code></pre>