Jose,
Yep, you're right. If I had bothered to play around with it just a little bit more, I would have seen that binding to the "SelectedItem" would have worked just fine. Probably easier than creating a little teeny DataSet just for the purpose of filling the combo. But, anyway, both methods work.
Thanks,
~~Bonnie
>Bonnie, you are right
>
>As I've posted the DataBindings.Add method, I was linking the combo
values to the dataset field, and those values do not get initialized when you load the combo via .AddRange
>
>The correct form of the DataBindings.Add, in my posted example, would be
>
>
>comboBox1.DataBindings.Add(
> new System.Windows.Forms.Binding(
> "SelectedItem", myDataSet, "Employee.Prefix"));
>
>The difference is "SelectedItem" instead of "SelectedValue"; this works because the Items collection is populated by the AddRange method.
>
>Thanks for the comment,
>Jose
>
>>Jose,
>>
>>For some reason, I've had trouble doing this (coded it exactly like you show, except C# instead of VB). It just wouldn't databind, so I ended up creating a DataSet and filling my combo from that. That worked.
>>
>>~~Bonnie
>>