title: Retrieving data from a VB.NET arraylist of objects
body: <p>I am trying to retrieve the correct value from an ArrayList of objects (.NET 1.1 Framework):</p>
  
  <p>I have the following defined:</p>
  
  <pre><code>Public AlList As New ArrayList
  
  Public Class ItemInfo
      Public ItemNo As Int16
      Public ItemType As String
      Public Reports As Array
      Public PDFs As Array
  End Class
  </code></pre>
  
  <p>The form_load event code contains:</p>
  
  <pre><code>Dim AnItemObj As New ItemInfo
  </code></pre>
  
  <p>Then a loop that includes:</p>
  
  <pre><code>AnItemObj.ItemNo = AFile.RecordId
  AnItemObj.ItemType = temp
  AlList.Add(AnItemObj)
  </code></pre>
  
  <p>So I should now have an ArrayList of these objects, however if I try to retrieve the data:</p>
  
  <pre><code>MsgBox(AlList(5).ItemNo)
  </code></pre>
  
  <p>I always get the ItemNo of the last value in the list.</p>
  
  <p>What am I missing?</p>