Ver Mensaje Individual
  #4 (permalink)  
Antiguo 02/11/2009, 09:20
rubenseguel
 
Fecha de Ingreso: octubre-2009
Mensajes: 29
Antigüedad: 15 años, 3 meses
Puntos: 0
Respuesta: Cargar una combox con dato seleccionado vb.net - win form

Aun sigo con problemas e probado las tres formas, miren estos codigos
Cargo la combobox con los datos de los ejecutivos
Protected Sub enlazarEjecutivoServicioCmb()
Dim EjecutivoServicioAdapter As New ComercialDataSetTableAdapters.EjecutivoServicioTab leAdapter()
Dim EjecutivoServicio As ComercialDataSet.EjecutivoServicioDataTable
EjecutivoServicio = EjecutivoServicioAdapter.GetData()
Me.CmbEjecutivoServicio.Items.Clear()

For Each EjecutivoServicioRow As ComercialDataSet.EjecutivoServicioRow In EjecutivoServicio
Me.CmbEjecutivoServicio.Items.Add(New MyList(EjecutivoServicioRow.EjecSer_Nombre, EjecutivoServicioRow.EjecSer_Corr))
Next
CmbEjecutivoServicio.Text = "Seleccione..."

End Sub


Posteriormente tengo un cliente con codigo de Ejecutivo que lo atiende
y deseo ubicar ese ejecutivo de ese cliente en la combobox cargada...
en Asp.net lo hacia asi, pero en VB.net con SQL no funciona

count = 0
For Each item As ListItem In Me.CmbEjecutivoVentas .Items
If item.Value = Clientes.Cl_EjecutivoVentas Then
Me.CmbEjecutivoVentas .SelectedIndex = count
Exit For
End If
count += 1
Next

Agradecere me puedan ayudar
saludos
Ruben