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
C#.NET Programming

Avatar of undefined
Last Comment
Carl Tawn

8/22/2022 - Mon