I would like to how I can load a set of values in a comboBox from a TableAdapter. I have the tableAdapter method to read the data , (in this case GetDataByStreet)--> Me.StreetsTableAdapter.GetDataByStreet()

But I don't know how to assign the sentence to the comboBox, in order to load the data set in it.

I have created this code to prove:

StreetCombo.DisplayMember = "AreaClasification"
StreetCombo.ValueMember = "AreaClasification"
StreetCombo.DataSource = Me.StreetTableAdapter.GetDataByStreet()

But It doesn´t work because only fills the first index of the comboBox, but not the following values.

Thanks with anticipation.


Try to use datatable with the dataadapter

'where sqlcon is a connection
'cboDepcode is the combobox

dt = New DataTable
        sda = New SqlDataAdapter("SELECT DEPTCODE FROM KDEPARTMENT", sqlcon)
        cboDepcode.DataSource = dt
        cboDepcode.DisplayMember = dt.Columns(0).ColumnName