Results 1 to 3 of 3

Thread: Load values of a comboBox from a TableAdapter

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2010
    Posts
    2

    Load values of a comboBox from a TableAdapter

    Hi,

    I would like to how I can load a set of values in a comboBox from a TableAdapter. I have the tableAdapter method to read the data , (in this case GetDataByStreet)--> Me.StreetsTableAdapter.GetDataByStreet()

    But I don't know how to assign the sentence to the comboBox, in order to load the data set in it.

    Thanks with anticipation.

    Regards

  2. #2

    Thread Starter
    New Member
    Join Date
    May 2010
    Posts
    2

    Re: Load values of a comboBox from a TableAdapter

    I have created this code to prove:

    Code:
     
    StreetCombo.DisplayMember = "AreaClasification"
    StreetCombo.ValueMember = "AreaClasification"
    StreetCombo.DataSource = Me.StreetTableAdapter.GetDataByStreet()
    But I doesn´t work because only fills the first index of the comboBox, but not the following values.

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Load values of a comboBox from a TableAdapter

    If there's only one value in your ComboBox then your query only matches one record, plain and simple.

    Also, "classification" is double "s".
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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