I use comboboxes a lot. I often loop through them to find a match based upon the SelectedValue, for example...
while(cmbCompany.SelectedValue.ToString()!=B1ID)
{
cmbCompany.SelectedIndex++;
}
a) am I missing some much quicker option!
b) if my comparison was against an integer, is there any benefit in declaring a string and setting that equal to the integer.ToString(), or if I just (in my example above) used B1ID.ToString() would the compiler optimise it for me?
c) or are string comparisons so slow that I'd be better off parsing (or casting) the SelectedValue to an integer?