Sub ConnectToDB()
Dim conn As New Odbc.OdbcConnection("Your connection String")
Dim cmd As New Odbc.OdbcCommand("select * from tablename;", conn)
' now you can read your data sequentally row by row
Dim rd As Odbc.OdbcDataReader
' OR with a data adapter
Dim ap As New Odbc.OdbcDataAdapter("select * from tablename;", conn)
Dim dt As New DataTable("tablename")
Try
' read data with the reader:
conn.Open()
rd = cmd.ExecuteReader
Do While rd.Read
Dim field1 As Object = rd.Item("field1")
Dim field2 As Object = rd.Item("field2")
' etc
Loop
conn.Close()
' Or read with the adapter
conn.Open()
ap.Fill(dt) ' Fill the datatable with values
' You can now assign your datatable as a datasource to some control
conn.Close()
Catch ex As Exception
' Something terrible has happenned - tell user.
End Try
End Sub