Imports System
Imports System.Data
Imports System.Data.Odbc
Dim conexion As OdbcConnection
Dim comando As OdbcCommand
Dim CadenaSQL As String = "SELECT * FROM Productos;"
conexion = new OdbcConnection("Driver={Microsoft ODBC for Oracle};Server=localhost;UID=GAB;PWD=123;") ' Donde: localhost es tu servidor, GAB es el usuario de tu base de datos, 123 es la contraseña.
'AHORA IMAGINEMOS QUE QUIERES LLENAR UN DATAGRID AL MOMENTO DE CARGAR UN FORMULARIO EN EL EVENTO LOAD.. TE QUEDARIA ALGO COMO ESTO:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
conexion.Open()
Dim tabla As New DataTable()
OdbcDataAdapter adapter As New OdbcDataAdapter(comando)
adapter.Fill(tabla)
dataGridView1.DataSource = tabla
conexion.Close()
Catch ex As Exception
MessageBox.Show(ex.Message,ex.Source)
End Try
End Sub