Espero te sirva.
Imports System.Data.SqlClient
Private CN As SqlConnection
Private DA As New SqlDataAdapter
' Con esto te conectas
Private Function Conectar(ByVal DA As SqlDataAdapter) As SqlDataAdapter
'Crear conexión
CN = New SqlConnection
Try
CN.ConnectionString = "Server=(local);" & "Database=BlackBox;uid=sa;pwd=sa;Integrated Security=SSPI;"
Catch ex As ArgumentException
MsgBox("Error:" & vbCrLf & "ConnectionString", MsgBoxStyle.Critical)
End Try
DA = New SqlDataAdapter
Return DA
End Function
'Una funcion para que ocupes la coneccion
Public Function Proveedor_Tabla() As DataSet
Conectar(DA)
DA.SelectCommand = New SqlCommand
DA.SelectCommand.Connection = CN
DA.SelectCommand.CommandText = "sp_TablaProveedores"
DA.SelectCommand.CommandType = CommandType.StoredProcedure
DS = New DataSet
DA.Fill(DS, "Proveedores")
DT = DS.Tables("Proveedores")
Return DS
End Function