Given a Combo box [Cb] and Dataset [ds].
Dataset [ds] is a set of distinct values from a column in my SQL Table, I want to display this list in the combo box. Mimicking my methods in VB6 I did the following:
Cb.DataSource = ds;
However instead of displaying the list of Customers [which it does in VB6] I get the following as the first and only value of the combo box:
System.Data.DataViewManagerListItemTypeDescriptor
XML structure and database represent the same thing . Instead of writing XML File name , you have to change that to your table name and add connection obj also .http://www.vbforums.com/showthread.p...hreadid=249117
Sadly I am unable to test the demo [You seem to have a newer version of .Net then me].
However I was able to open the form and test the code.
When attempting to populate the Combo box I get the following error: "Cannot find Column 1" and then halts.
This error is not on Compile [code compiles perfectly]
Now I know my Dataset is ok because If I put a Datagrid and assign my Dataset as the Datasource, the Datagrid outputs exactly what I want in the combo box.
The Dataset houses the results from my SQL Query Select statement.
For Testing purposes the SQL Database is LOCALHOST but will not be when the application is launched [however this shouldn't make any difference, the Dataset has the proper results].
I have a Table [Store] with 5 Columns [StoreName, StoreType, Mode1, Mode2, StoreID]. After my SQL Query Statment [posted below] I get a list of unique StoreNames in the DataSet.
For Example: Table [Store]:
StoreName StoreType Mode1 Mode2 StoreID
Mar ACX NO NO Unique Identifier
Mar BCX NO YES Unique Identifier
Walls ACX YES YES Unique Identifier
Walls XVX NO YES Unique Identifier
.........
Thus I want the Combobox to have 2 choices:
Mar
Walls