[RESOLVED] Adding records to combobox
I'm trying to read the records into a combobox from the database without any success. There is no problem with the connection, but something seems wrong with my coding. Perhaps someone could tell me what I'm doing wrong.
vb.net Code:
Dim reader_combo_plaats As SqlCeDataReader
Dim cmd_Plaats As New SqlCeCommand("SELECT DISTINCT plaats FROM beslagdata", connStr)
reader_combo_plaats = cmd_Plaats.ExecuteReader
While reader_combo_plaats.Read
mdi_beslag.ts_cbo_plaats.Items.Add(reader.Item("plaats").ToString) ' <<< here is the problem
End While
Re: Adding records to combobox
What is the error you get?
Re: Adding records to combobox
Btw: if you look at this line in your code :
Code:
mdi_beslag.ts_cbo_plaats.Items.Add(reader.Item("plaats").ToString)
you use "reader.item("plaats").tostring" while you declared your sqlDataReader as "reader_combo_plaats".
Re: Adding records to combobox
AAAAAAAAAAAAAAH!!!! SO... STUPID!!!! STUPID!!!! STUPID!!!! STUPID!!!! :sick:
Woke up 5.30 am this morning to do some work. Seems that it was to early for me. Thanks man. You saved my day. Very greatfull for that. :thumb:
Re: [RESOLVED] Adding records to combobox
Hmm... Do you know how to add a progressbar while reading?