title: retrieving data from SQL in VB (part 2)
body: <p>I am trying to populate a listbox by retrieving data from a database through sql. I have asked this question earlier but i was using a different configuration and the one i'm using now isn't giving any results.</p>
  
  <p><a href="https://stackoverflow.com/questions/14529534/retrieving-data-in-vb-from-sql">retrieving data in VB from SQL</a></p>
  
  <p>That is my old post. I will now provide the code to the newer version of my attempt.</p>
  
  <pre><code>Imports System.Data.Sql
  Imports System.Data.SqlClient
  
  
  Public Class Form1
  
      Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
          Dim conn As New SqlConnection
          conn.Open()
          Dim comm As New SqlCommand("SELECT name FROM Table_1", conn)
          Dim reader As SqlDataReader = comm.ExecuteReader
          Dim dt As New DataTable
          dt.Load(reader)
          ListBox1.Items.Add(dt)
  
  
      End Sub
  End Class
  </code></pre>
  
  <p>If anyone would be willing to help me out i'd greatly appreciate it. If possible, use a practical approach when trying to enlighten me, as that works best.</p>
  
  <p>edit 1</p>
  
  <pre><code>Imports System.Data.Sql
  Imports System.Data.SqlClient
  
  
  Public Class Form1
  
  Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
      Dim connString As String = "Data Source=THE_SHOGUNATE\SQLEXPRESS;Initial Catalog=le_database;Integrated Security=True"
      Dim conn As New SqlConnection(connString)
      conn.Open()
      Dim comm As New SqlCommand("SELECT name FROM Table_1", conn)
      Dim reader As SqlDataReader = comm.ExecuteReader
      Dim dt As New DataTable
      dt.Load(reader)
      ListBox1.DataSource = dt
  
  
  End Sub
  End Class
  </code></pre>
  
  <p>With this code the listbox populates with 6 instances of "System.Data.DataRowView" strings, 6 being the number of items in my table. How do i get the actual values?</p>