DataReader and ComboBox BlankLine

  • Thread starter Thread starter Tim Ford
  • Start date Start date
T

Tim Ford

People,

I trying to write a lookup combobox that gets it's data via a sql table.

I can populate the combobox with the information and have handled all
the filtering, how ever i can't seem to add a blank row to the combobox,
i have tried adding via the datatable and i can't seem to get that to
work. However is there a way via the datareader to populate the combobox
with a text value and id without assigning a object to the combobox.

Thanks Tim.
 
If your ComboBox is bound to the DataTable, adding a new row to the
DataTable should present a new entry in the ComboBox. Are you saying that
this is not the case ?

Regards - OHM

Tim said:
People,

I trying to write a lookup combobox that gets it's data via a sql
table.

I can populate the combobox with the information and have handled all
the filtering, how ever i can't seem to add a blank row to the
combobox, i have tried adding via the datatable and i can't seem to
get that to work. However is there a way via the datareader to
populate the combobox with a text value and id without assigning a
object to the combobox.

Thanks Tim.

Regards - OHM# OneHandedMan{at}BTInternet{dot}com
 
Yep this sure is the case, i keep on getting a dbull=readonly error. any
idea??

Thanks Tim.
 
I created a similar scenario to you., albiet using a dataAdapter rather than
a DataReader,and was able to add something to the table with no problems.

Suggest that the first thing is to debug this and prove that you are adding
a row to your DataTable. You will not be able to add items directly to the
list while the control is bound I dont think.

Regards - OHM



Dim tr As DataRow = Ds1.Tables(0).NewRow()

tr(9) = "Crap"

Ds1.Tables(0).Rows.Add(tr)



Tim said:
Yep this sure is the case, i keep on getting a dbull=readonly error.
any idea??

Thanks Tim.

Regards - OHM# OneHandedMan{at}BTInternet{dot}com
 
Back
Top