Solved

populate combo box from dataset

Posted on 2008-06-24
8
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

751 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