Is it possible to populate a ComboBox's DisplayMember and the ValueMember via a SqlDataReader in C#?

I know how to do it off of a dataset, but I would rather not incur the overhead since it is just a display field that is used to populate other information from the key value (ValueMember).

Larry

Re: Populate ComboBox with a DataReader by Mohamoss

Mohamoss
Thu Jan 22 04:26:24 CST 2004

Hi Lary

You can do it by looping through the data Reader and adding the items one
by one. But you can?t bind a control to data reader in windows apps since it
is a fast forward read only object. You can do that in webApps though.

Thanks ,


--
Mohamed Mossad
Microsoft GTSC Developer support for Middle East


"Larry" <larrystewart[SPAMCTRL]@moodyreview.com> wrote in message
news:71DEDC69-0A90-42D4-A125-EBCAD1881261@microsoft.com...
> Is it possible to populate a ComboBox's DisplayMember and the ValueMember
via a SqlDataReader in C#?
>
> I know how to do it off of a dataset, but I would rather not incur the
overhead since it is just a display field that is used to populate other
information from the key value (ValueMember).
>
> Larry