Results 1 to 5 of 5

Thread: Bind combobox problemo??

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Bind combobox problemo??

    I have populated a combobox with the following:

    daCombo.FillSchema(dsCombo, SchemaType.Source, "tblItems")
    'fiLLDATASET WITH INFO FROM DATAADAPTOR
    daCombo.Fill(dsCombo, "tblItems")
    'empty combo box
    ComboBox2.Items.Clear()
    'fill combobox2
    ComboBox2.DataSource = dsCombo.Tables("tblitems")
    ComboBox2.DisplayMember = "itemDescription"
    ComboBox2.ValueMember = "itemID" *causing probs here

    When I run the code I get the following error message:

    Additional information: Could not bind to the new display member

    Can someone tell me why I cant Add a value member?

    I need to store the "itemID" so I can search on my form.

    Thanks in Advance

    Parksie

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Are "itemDescription" and "itemID" fields in "tblitems"? Are there any spelling mistakes? Everything looks right at a glance.

  3. #3

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018
    They are field names and they are not misspelled.

    Wierd or what>???

    Parksie

  4. #4

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018
    Thanks Edneeis.

    I just had a look at my code.

    When i changed "itemDescription" and "itemID" to "ItemDescription" and "ItemID" it worked.

    I didn't realise it was case sensitive.

    Parksie

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I'm glad it was something small. I didn't realize they were case sensitive either.

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