title: Access multiple controls via an array rather than individually?
body: <p>I wonder if anyone can help me with the following please?</p>
  
  <p>I have 20 labels on my form, named "Name1", "Name2" etc.....
  I want to read from a DB and populate each label with its corresponding value from the DB row.</p>
  
  <p>At the moment the code does this the long way:</p>
  
  <pre><code>Name1.Text = dt.Rows(0).Item("Name1")
  Name2.Text = dt.Rows(0).Item("Name2")
  etc.....
  </code></pre>
  
  <p>I want to use an array and a loop to reduce the code, but I'm not sure what I need to do.
  The below works perfectly, apart from instead of Name1.Text I actually want it to be Name(i).text = .......
  Suffice to say this doesn't work, so I'd like to know what I'm doing wrong.</p>
  
  <pre><code>For i As Int16 = 1 To 20
      Name1.Text = dt.Rows(0).Item("Name" &amp; (i))
  Next
  </code></pre>
  
  <p>Thank you,</p>