title: Populate integers to dropdownlist using a loop
body: <p>Can't figure out why my program wont populate my <strong>DropDownList</strong> using a loop. </p>
  
  <p>So far I've tried these two scenarios:</p>
  
  <pre class="lang-vb prettyprint-override"><code>'Fill in the year box from current year to 100 years ago.
  '(Safe to assume no one over 100 will be signing up for site)
  
  Dim CurYear As Integer = Date.Now.Year
  Dim CurYearMinus100 As Integer = CurYear - 100
  Dim Index As Integer = 0
  
  Do While CurYear &gt;= CurYearMinus100
      DropDownListYear.Items.Insert(Index, CurYear)
      Index += 1
      CurYear -= 1
  Loop
  </code></pre>
  
  <p>I've also tried using the <code>.Add()</code> functionality instead of insert:</p>
  
  <pre class="lang-vb prettyprint-override"><code>Dim CurYear As Integer = Date.Now.Year
  Dim CurYearMinus100 As Integer = CurYear - 100
  
  Do While CurYear &gt;= CurYearMinus100
      DropDownListYear.Items.Add(Index)
      CurYear -= 1
  Loop
  </code></pre>