newbee question

  • Thread starter Thread starter EMW
  • Start date Start date
E

EMW

I have a dataset containing 1 table with 1 column and I want to put the
values of each row in a combobox.

I've tried this:

Me.cbSitenummers.DataSource = dsShow.Tables(0)
Me.cbSitenummers.DisplayMember = dsShow.Tables(0).Columns(0).Caption
Me.cbSitenummers.ValueMember = dsShow.Tables(0).Columns(0).Caption

But the combobox remains empty and DataSource = nothing.

I know the dataset is filled, because the DisplayMember and ValueMember
properties are set to the rigth column name.
What am I doing wrong?

rg,
Eric
 
EMW said:
I have a dataset containing 1 table with 1 column and I want to put the
values of each row in a combobox.

I've tried this:

Me.cbSitenummers.DataSource = dsShow.Tables(0)
Me.cbSitenummers.DisplayMember = dsShow.Tables(0).Columns(0).Caption
Me.cbSitenummers.ValueMember = dsShow.Tables(0).Columns(0).Caption

But the combobox remains empty and DataSource = nothing.

Hi -

I use the following to fill a CheckedListBox control:

<note>"ds" is a DataSet the has been filled already</note>

for(int i = 0; i < ds.Tables[0].Rows.Count; i++){
//add items unchecked
this.checkedListBoxName.Items.Add(ds.Tables[0].Rows[0], false);
}
 
Back
Top