title: How do you assign values to structure elements in a List in VB.NET?
body: <p>I have a user-defined structure in a list that I am trying to change the value for in an individual element within the list of structures.  Accessing the element is not a problem. However, when I try to update the value, the compiler complains:</p>
  
  <blockquote>
    <p>"Expression is a value and therefore cannot be the target of the
    assignment"</p>
  </blockquote>
  
  <p>For example:</p>
  
  <pre><code>Public Structure Person
  
      Dim first as String
      Dim last as String
      Dim age as Integer
  
  End Structure
  </code></pre>
  
  <p>_</p>
  
  <pre><code>Public Sub ListTest()
  
      Dim newPerson as Person
  
      Dim records as List (Of Person)
      records = new List (Of Person)
  
      person.first = "Yogi"
      person.last = "bear"
      person.age = 35
  
      records.Add(person)
      records(0).first = "Papa"  ' &lt;&lt;== Causes the error
  End Sub
  </code></pre>