How to display the names of my SQL Server tables in a listbox using vb.net?
<p>I want to show the names of the tables I have in my SQL Server database in a listbox using vb.net.</p>

<p>I tried this but it's not working:</p>

<pre><code> connetionString = "Data Source=ABDELOUAHED;Initial Catalog=table_creances;integrated security=true"
 connection = New SqlConnection(connetionString)

 sql = "select * from table_creances"

 Try
        connection.Open()
        adapter = New SqlDataAdapter(sql, connection)
        ds.Clear()
        adapter.Fill(ds)
        connection.Close()
        ListBox1.DataSource = ds.Tables(0)
    Catch ex As Exception
        MsgBox(ex.ToString)
    End Try
</code></pre>

<p><code>table_creances</code> is the name of my database.</p>

<p>Any help is very appreciated. </p>