DataBinding Question

  • Thread starter Thread starter Jake
  • Start date Start date
J

Jake

Hi,

Right now in my app I am using databinding for some of my combo boxes. I
only uses databinding to display the data to the user. Here is my question.
Since, databinding keeps the dataset in memory is it better just to loop
through the dataset table and add each item? Or should I create an array
list from a datareader object to display the data? I would use the
datareader object however I would have to pass the datareader from the
database to the business component then to the UI. Any suggestions?

Thanks
 
Suggestion: create a custom object which inherits from
CollectionBase and add each item in the datareader to the
object as a collection.

Suggestion: populate or return a Hastable of values from
the datareader, you can bind the Hashtable straight to the
combo box using it's datavaluefield and datatextfield
properties.

Suggestion: Use a DataView or DataTable and pass it back,
it has less overhead.

I have a few more if you don't like those. These are just
off the top of my head!

- Rob
 
Thanks for the reply. By passing the dataset and looping through the table
have that much overhead? Your suggestion passing the datatable object
probably be the best option.

Thanks again
 
Back
Top