Results 1 to 5 of 5

Thread: [RESOLVED] Adding records to combobox

  1. #1

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Resolved [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:
    1. Dim reader_combo_plaats As SqlCeDataReader
    2. Dim cmd_Plaats As New SqlCeCommand("SELECT DISTINCT plaats FROM beslagdata", connStr)
    3.  
    4. reader_combo_plaats = cmd_Plaats.ExecuteReader
    5. While reader_combo_plaats.Read
    6.     mdi_beslag.ts_cbo_plaats.Items.Add(reader.Item("plaats").ToString)  ' <<< here is the problem
    7. End While


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  2. #2
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    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

  3. #3
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    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

  4. #4

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    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.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  5. #5

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: [RESOLVED] Adding records to combobox

    Hmm... Do you know how to add a progressbar while reading?


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width