Link to home
Create AccountLog in
Avatar of 98fatboyrider
98fatboyrider

asked on

Populating a combobox with values from SQL database

I need to populate a combobox with values from a dataset. When running the code below, I recieve "Cannot bind to the new display member.Parameter name: newDisplayMember". Any suggestions?

        DAL rating = new DAL();
        DataSet ds = rating.getRatings("SELECT * FROM tblRating");
        cboRating.DataSource = ds;
        cboRating.DisplayMember = "Rating"; //Colunm name for display
        cboRating.ValueMember = "RatingID"; //Primary key <----Error here
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer