I'm pretty new to the world of C# and .Net and enjoying it so far.
I'm having trouble setting the index value in a combobox. I'm using MySQL connector/Net and because it doesn't provide certain tools/extensions to work with Visual Studio I have to do certain things manually (which isn't problem because it helps me understand C# and .Net better). :^)
My original intention was to take names and ids from a table and use the id as the index in the combobox list and the names as display. I get a full list of the names no problems. But the index is always the same, integers incremented with each item.
As you can see I've tried creating a table myself and it still doesn't work. You will get a better idea of what I'm trying to achieve below.
DataTable dsTbl = new DataTable("Category"); catCombo.DataSource = dsTbl; |
Appreciate any help anyone can offer!