Link to home
Start Free TrialLog in
Avatar of CraigLazar
CraigLazar

asked on

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
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Do you have a field name DisplayField in your datatable?
Avatar of CraigLazar
CraigLazar

ASKER

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
are you sure that ItemName and ItemID are columns in SPds.Tables("lstLookupList")?
ASKER CERTIFIED SOLUTION
Avatar of SQL_SERVER_DBA
SQL_SERVER_DBA
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
.databind is only available in ASP.Net. Are you doing a web application?
Hi,
Emoreau no its a vb.net fat client that i am using
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks for the input