title: Getting Data from SQL and putting in a list
body: <p>I am getting data from SQL and putting it in list. here's what I am trying now,</p>
  
  <pre><code>public class Fruit //custom list
  {
       public string aID { get;set; }  // can be more then 1
       public string bID { get;set; }  // only 2 but different aID
       public string name { get;set; } // only 1 for selection of aID and bID
  }
  </code></pre>
  
  <p>and this is how i am getting data from sql,</p>
  
  <pre><code>var Fruitee = new Fruit();
  
  using (SqlConnection cn = new SqlConnection(CS()))
  {
        cn.Open();
        SqlCommand sqlCommand= new SqlCommand("SELECT * FROM myTable", cn);
        SqlDataReader reader = sqlCommand.ExecuteReader();
        while (reader.Read())
        {
               Fruitee.add(reader["aID"], reader["bID"],reader["name"]) // ??? not sure what to put here  as add is not available
        }
        cn.Close();
  }
  </code></pre>
  
  <p>Table looks like this,</p>
  
  <p>aID,  bID, name</p>
  
  <p>**</p>
  
  <ul>
  <li>Problem</li>
  </ul>
  
  <p>**</p>
  
  <p>I am stuck how to add items to list and <strong>also is it best practice ?</strong></p>