Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

populate combo box from dataset

Hi,
Please help with the code below, i have a dataset and i need to filter on 1 of the tables for certain values and then popultae my combo box
here is the code i am using but i am getting the following error
"Cannot bind to the new display member"
ItemName is my field in teh Dataset

            'This is for the combo box on the SCI Users pannel
            drows = SPds.Tables("lstLookupList").Select("Category = 'SCIUsersStatus'") '
            With frmMain.cmbSCIUsersStatus
                .DataSource = drows
                .DisplayMember = "DisplayField"
                .ValueMember = "ItemName"
            End With


thanks
0
CraigLazar
Asked:
CraigLazar
  • 4
  • 3
2 Solutions
 
Éric MoreauSenior .Net ConsultantCommented:
Do you have a field name DisplayField in your datatable?
0
 
CraigLazarAuthor Commented:
Hi
i checked that after i posted the code sorry
           'This is for the combo box on the SCI Users pannel
            drows = SPds.Tables("lstLookupList").Select("Category = 'SCIUsersStatus'") '
            With frmMain.cmbSCIUsersStatus
                .DataSource = drows
                .DisplayMember = "ItemName"
                .ValueMember = "ItemID"
            End With

still same error
0
 
Éric MoreauSenior .Net ConsultantCommented:
are you sure that ItemName and ItemID are columns in SPds.Tables("lstLookupList")?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
SQL_SERVER_DBACommented:
           With frmMain.cmbSCIUsersStatus
                .DataSource = drows
                .DisplayMember = "ItemName"
                .ValueMember = "ItemID"
.databind
            End With
0
 
Éric MoreauSenior .Net ConsultantCommented:
.databind is only available in ASP.Net. Are you doing a web application?
0
 
CraigLazarAuthor Commented:
Hi,
Emoreau no its a vb.net fat client that i am using
0
 
Éric MoreauSenior .Net ConsultantCommented:
So Databind does not exist as a method.

are you sure that ItemName and ItemID are columns in SPds.Tables("lstLookupList")?
0
 
CraigLazarAuthor Commented:
thanks for the input
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now