title: Populate DropDownList with ArrayList set Text and Data Fields
body: <p>I am trying to populate a dropdownlist with queried data based on the selection of another dropdownlist. My first query returns a list of IDs using the following code:</p>
  
  <pre><code>Dim selectQuery = (From train In trainerEntities.TrainerTrainingCompanies
      Where train.TrainingCompanyID = trainingCompany.ID
      Select train.TrainerID).ToList()
  </code></pre>
  
  <p>I then create an arraylist and a second query</p>
  
  <pre><code>Dim trainers As New ArrayList
  
  For Each trainerID In selectQuery
      Dim selectQuery2 = (From pers In trainerEntities.Persons
                          Where pers.Person_ID = trainerID
                          Select pers.Person_ID, pers.Last_Name).ToList()
      trainers.Add(selectQuery2)
  Next
  </code></pre>
  
  <p>Finally I use the arraylist as a datasource and bind the data</p>
  
  <pre><code>TrainerDropDownList.DataSource = trainers
  TrainerDropDownList.DataBind()
  </code></pre>
  
  <p>The list populates, but not with any data. It looks like this:</p>
  
  <pre><code>System.Collections.Gerneric.List'1[VB$AnonymousType_0'2[System.Int32,System.String]]
  </code></pre>
  
  <p>When debugging and looking at the array list I see the proper amount of items and the proper information in each specific item. Looking at what the list is populated with from above I am sure the Int32 value is the Person_ID and what I want to use for the dropdownlist value field and the String value is the Last_Name and what I want to used for the dropdownlist text field.</p>
  
  <p>Using:</p>
  
  <pre><code>dropdownlist.DataTextField("Last_Name") 
  dropdownlist.DataValueField("Person_ID")
  </code></pre>
  
  <p>produces and error on databind.</p>
  
  <pre><code>does not contain a property with the name 'trainers.Last_Name'
  </code></pre>
  
  <p>How do I properly use this arraylist as my datasource for my dropdownlist</p>