Results 1 to 2 of 2

Thread: Help with CBO Please

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2012
    Posts
    63

    Help with CBO Please

    Hello all,

    I need a cbo I created to pull info from a database, and I need it to display the text that is from the database. I know the code to do this, however when I go to type into code, there is no option from the drop down list to chose from it so it won't let me chose it. The code I need to write is

    Code:
    cb.DataTextField = "PLAYER_NAME"
    but VS isn't recognizing the "DataTextField part. Does anyone know why this might be happening to me? Thanks in advance.

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

    Re: Help with CBO Please

    You might try posting clearly in future. By "cbo" do you actually mean ComboBox? If so then the reason Intellisense doesn't show you a DataTextField property is that there is no such property on that class. Did you consider reading the documentation for the ComboBox class to see what properties it does have? If you had you would see that the property you want is DisplayMember. Perhaps DataTextField is the equivalent property in VB6 but VB.NET is not VB6 so, while the syntax is basically the same, don't assume that anything else will and just consider it a bonus if they are.
    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