I am trying to populate a combobox using a DataTable returned from SQL via SQLDataAdapter.
The combobox entries should display as the strings from the VendorName column but they are showing as the Integers from the ID column.
Can anyone spot what I've missed?
DataTable vendors = sql.GetData("SELECT id, VendorName FROM Vendors ORDER BY VendorName", "Q");
drpVendor.DataSource = vendors;
drpVendor.DisplayMember = "VendorName";
drpVendor.ValueMember = "id";
drpVendor.SelectedIndex = 0;
I have verified the contents of the DataTable vendors by assigning it as a the DataSource of a DataGridView as shown below: