title: VB ASP Array prevent multi reading
body: <p><img src="https://i.stack.imgur.com/X7yww.png" alt="enter image description here"></p>
  
  <p>This is my 'code':</p>
  
  <pre><code> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
  
  Dim arrName As New ArrayList()
          Dim con As New SqlConnection
          Dim cmd As New SqlCommand
          Dim rdr As SqlDataReader
          con.ConnectionString = "Data Source=.\sqlexpress;Initial Catalog=GradingSystemSample;Integrated Security=True;Pooling=False"
          cmd.Connection = con
          con.Open()
  
          cmd.CommandText = "select numb FROM Table2  "
          rdr = cmd.ExecuteReader
          If rdr.HasRows Then
              While rdr.Read
  
                  arrName.Add(rdr("numb"))
                  For Each pno As String In arrName
                      MsgBox(pno)
                  Next
  
              End While
  
          End If
  End sub
  </code></pre>
  
  <p><strong>I want my output to be:</strong>
  639057318820
  639355514108
  639056784959</p>
  
  <p><strong>but my code output is:</strong>
  639057318820
  639057318820
  639355514108<br>
  639057318820
  639355514108<br>
  639056784959</p>
  
  <p>it seems like my code is reading is reading from the indexes 0 before reading the next index. help me guys?</p>