Results 1 to 2 of 2

Thread: Help with CBO Please

  1. #1
    Member
    Join Date
    Feb 12
    Posts
    59

    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
    .NUT jmcilhinney's Avatar
    Join Date
    May 05
    Location
    Sydney, Australia
    Posts
    80,742

    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.

Posting Permissions

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