Imports System.Data.Odbc
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sql As String = "SELECT RepCode FROM hflAdvisoryReports"
Dim cn As New OdbcConnection("DSN=MyDataSource")
Dim cm As New OdbcCommand(sql, cn)
Dim da As New OdbcDataAdapter(cm)
Dim ds As New DataSet
da.Fill(ds, "hflAdvisoryReports")
ListBox1.DataSource = ds.Tables("hflAdvisoryReports")
ListBox1.ValueMember = "RepCode"
ListBox1.DisplayMember = "RepCode"
cm = Nothing
da = Nothing
ds = Nothing
cn.Close()
End Sub
End Class