Solved

populate combo box from dataset

Posted on 2008-06-24
8
230 Views
Last Modified: 2013-11-26
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
Comment
Question by:CraigLazar
  • 4
  • 3
8 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 21855776
Do you have a field name DisplayField in your datatable?
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 21855921
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
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 21856818
are you sure that ItemName and ItemID are columns in SPds.Tables("lstLookupList")?
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 16

Accepted Solution

by:
SQL_SERVER_DBA earned 25 total points
ID: 21856874
           With frmMain.cmbSCIUsersStatus
                .DataSource = drows
                .DisplayMember = "ItemName"
                .ValueMember = "ItemID"
.databind
            End With
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 21856967
.databind is only available in ASP.Net. Are you doing a web application?
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 21862778
Hi,
Emoreau no its a vb.net fat client that i am using
0
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 25 total points
ID: 21863943
So Databind does not exist as a method.

are you sure that ItemName and ItemID are columns in SPds.Tables("lstLookupList")?
0
 
LVL 4

Author Closing Comment

by:CraigLazar
ID: 31470130
thanks for the input
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question