I have a combobox that list two items. Lets call it cbxCombo. I have
a table extracted from an MS SQL database. This table has a column
that will either be 1 or 2. If the value in the table is 1, the
cbxCombo.SelectedIndex = 0. If the value in the table is 2 the
cbxCombo.SelectedIndex = 1. How do I go about extacting that value
from the column so that I can test it in an if statement.
I'm using C#
Ideally it would look something like this.
if(dataset.datatable.Columns["column"] == 1)
{
cbxCombo.SelectedIndex = 0
}
The data types in the "if" statements are different and I understand
why it doesn't work. Question is how does one make it work.