title: fetch datarow to c# object
body: <p>I have an class Item that represents an item in a list. I have in it function that calls stored procedure that returns datatable and I need to convert the datatable to Array of items.
  Here is what I do:</p>
  
  <pre><code>public class Item
  {
      private string _ItemIdDataName = "item_id";
      private string _ItemNameDataName = "item_name";
      private string _PriceDataName = "price";
  
      public long ItemId { get; set; }
      public string ItemName { get; set; }
      public float Price { get; set; }
  
      private Item(DataRow row)
      {
          if (row != null)
          {
              ItemId = long.Parse(row[_ItemIdDataName].ToString());
              ItemName = row[_ItemNameDataName].ToString();
              Price = float.Parse(row[_PriceDataName].ToString());
          }
      }
  
      public Item[] load()
      {
          DataTable dt=DBHandler.GetItems();//Stored procedure that returns DataTable 
          Item[] items = new Item[dt.Rows.Count];
          for (int i = 0; i &lt; dt.Rows.Count; i++)
          {
              items[i] = new Item(dt.Rows[i]);
          }
          return items;
      }
  }
  </code></pre>
  
  <p>Am I doing it right?
  How can I improve this?</p>