Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/08/2013, 08:43
netspider76
 
Fecha de Ingreso: julio-2013
Ubicación: Colombia
Mensajes: 11
Antigüedad: 10 años, 9 meses
Puntos: 0
Respuesta: Rellenar ComboBox con datos desde mysql

hola pues la verdad no se como seria desde la interfas de visual yo actualmente uso visual studio 2012 al final investigando consegui resolverlo de la siguiente forma

Private Sub Laboratorios_Load(sender As Object, e As EventArgs) Handles MyBase.Load


'crear la conexion
Dim oConexion As MySqlConnection
oConexion = New MySqlConnection
oConexion.ConnectionString = "Server=localhost;Database=prueba;Uid=root;Pwd=*** ****;"
Dim sSel As String = "SELECT * FROM sel_lab ORDER BY idlaboratorios"

Try
da = New MySqlDataAdapter(sSel, oConexion)
dt = New DataTable
da.Fill(dt)
Catch ex As Exception
MsgBox("ERROR DE CONECCION")

End Try

'combobox
cbolab.DataSource = dt
cbolab.DisplayMember = "laboratorio"
cbolab.ValueMember = "idlaboratorios"

End Sub