The ProblemUsing VB.NET, I'm trying to databind a ComboBox to a DataView that I populated using SQL. No matter what I do, it returns the right number of fields in the ComboBox, but every single one just says "System.Data.DataRowView". I've tried using the dataset directly instead of the dataview with no change in result. My code looks something like this: SQLcommand = "select id, column1 from mytable" cbo.DisplayMember = "Column1" My program looks like this:
The number of lines is correct, the table returns three rows. The problem is I can't get it to display the data in the rows. The SolutionA BIG thank you to "Liebrand" on Experts-Exchange.com for this answer. The "DisplayMember" and "ValueMember" values are CASE SENSITIVE. Argh. Either change the SQLcommand to look like this: SQLcommand = "select ID, Column1 from mytable" or change the code to look like this: cbo.DisplayMember = "column1" |
|
Vancouver: 604-249-4486 Victoria: 250-412-1593
Edmonton: 780-701-7167
|