title: Displaying Data from SQL to vb.net listbox
body: <p>I'm trying to display all the golfer's information from TGolfers into a ListBox. But when I run my code it only displays one golfer's information.</p>
  
  <pre><code>Public Class frmGolfers
  
      Private Sub btnDisplay_Click(sender As Object, e As EventArgs) Handles btnDisplay.Click
  
          Dim strSelect As String = ""
          Dim strName As String = ""
          Dim cmdSelect As OleDb.OleDbCommand ' this will be used for our Select statement
          Dim drSourceTable As OleDb.OleDbDataReader ' this will be where our data is retrieved to
          Dim dt As DataTable = New DataTable ' this is the table we will load from our reader
  
          ' open the database
          If OpenDatabaseConnectionSQLServer() = False Then
  
              ' No, warn the user ...
              MessageBox.Show(Me, "Database connection error." &amp; vbNewLine &amp; _
                                  "The application will now close.",
                                  Me.Text + " Error",
                                  MessageBoxButtons.OK, MessageBoxIcon.Error)
  
              ' and close the form/application
              Me.Close()
  
          End If
  
          ' Build the select statement using PK from name selected
          strSelect = "SELECT * FROM TGolfers "
  
          ' Retrieve all the records 
          cmdSelect = New OleDb.OleDbCommand(strSelect, m_conAdministrator)
          drSourceTable = cmdSelect.ExecuteReader
  
          ' load the data table from the reader
          dt.Load(drSourceTable)
  
          ' populate the text boxes with the data
          lbxDisplay.Items.Add(dt.Rows(0).Item(1).ToString &amp; "," &amp; " " &amp; dt.Rows(0).Item(2).ToString &amp;
                             ControlChars.CrLf &amp; " " &amp; dt.Rows(0).Item(3).ToString &amp; " " &amp; dt.Rows(0).Item(4).ToString &amp; " " &amp; dt.Rows(0).Item(5).ToString &amp; " " &amp; dt.Rows(0).Item(6).ToString)
  
  
          ' close the database connection
          CloseDatabaseConnection()
  
      End Sub
  End Class
  </code></pre>