title: How to return list of records using stored procedure and datareader in C#
body: <p>I want to return list of records using stored procedure and datareader in C#. Currently, it is giving me error</p>
  
  <blockquote>
    <p>Cannot implicitly convert type 'ClsHorseTracker' to 'System.Collections.Generic.List'</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>public List&lt;ClsHorseTracker&gt; HorseTrackerList()
  {
      clsUtilities clsUtilities = new clsUtilities();
      DataSet ds;
      List&lt;ClsHorseTracker&gt; clsHorseTracker = new List&lt;ClsHorseTracker&gt;();
  
      string sSQL = "exec HorseDetails";
      ds = clsUtilities.GetDataSet(sSQL);
  
      SqlCommand cmd = new SqlCommand();
  
      using (SqlDataReader reader = cmd.ExecuteReader())
      {
          if (reader.HasRows)
          {
              while (reader.Read())
              {
                  clsHorseTracker = new ClsHorseTracker
                      {
                          HorseName = Convert.ToString(reader["HorseName"]),
                          HorseTypeName = Convert.ToString(reader["HorseTypeName"]),
                      };
              }
          }
      }
  
      return clsHorseTracker;
  }
  </code></pre>