Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Populating list objects
Message
From
09/09/2003 00:46:03
Keith Payne
Technical Marketing Solutions
Florida, United States
 
 
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00827157
Message ID:
00827376
Views:
16
You can actually bind the DataSource of a list control directly to the DataReader. However, I think a cleaner method is to populate an ArrayList or SortedList object and bind the DataSource to it.

>Is it possible to populate a list object (ListBox or ComboBox) from a DataReader?
>
>When using the ComboBox.Items.Add() method, (which is what I intended on using with the data retreived via a DataReader), it appears that you can only add a single column of values. Specifying a column to associate with the DisplayMember and ValueMember properties seems to require that I specify a DataTable or DataView as the DataSource.
>
>I suppose I could transfer the values from the DataReader to a manually-constructed DataSet, but that seems like going 'round the block to get next door <bg>.
>
>Thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform