Pegar Valor e Texto do ComboBox - Carregado manualmente - VB.net
Pessoal estou tentado pegar o valor e texto de um combobox porémnão estou conseguindo.
eu utilizo essa função abaixo para carregar o combo, ele esta carregando certinho, apresenta corretamente porém não consigo pegar os valores do combo.
Public Function CarregaCombo(combo As ComboBox, ByVal strsql As String, ByVal texto As String, ByVal valor As String) As DataSet
Try
Dim objAdapter As SqlDataAdapter
objAdapter = New SqlDataAdapter(strsql, SCLConnectionString)
Dim Ds As New DataSet
objAdapter.Fill(Ds, "Combo")
'drop.DataTextField = texto
combo.DisplayMember = texto
combo.ValueMember = valor
combo.DataSource = Ds.Tables("Combo")
combo.Refresh()
objAdapter.Dispose()
Catch ex As Exception
Throw ex
End Try
Return Ds
End Function
ja tentei selectedindex, selectedtext, selectedvalue e nada.
Discussão (4)
Carregando comentários...