|
-
Jul 9th, 2009, 06:22 AM
#1
Thread Starter
PowerPoster
[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
-
Jul 9th, 2009, 06:56 AM
#2
Re: Adding records to combobox
What is the error you get?
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Jul 9th, 2009, 07:08 AM
#3
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".
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Jul 9th, 2009, 07:35 AM
#4
Thread Starter
PowerPoster
Re: Adding records to combobox
AAAAAAAAAAAAAAH!!!! SO... STUPID!!!! STUPID!!!! STUPID!!!! STUPID!!!! 
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.
-
Jul 9th, 2009, 07:55 AM
#5
Thread Starter
PowerPoster
Re: [RESOLVED] Adding records to combobox
Hmm... Do you know how to add a progressbar while reading?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|