assigning DataSource for ListControl - performance

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
i use SqlCeDataAdapter to load large amount of data for displaying in
ComboBox and it is very slow. I found that SqlCeDataAdapter.Fill method takes
only 1/3 of that time and it seems that assigning DataTable to
ListControl.DataSource property creates a new copy of datasource i am
assigning it to instead of referencing my one. This assignment takes another
2/3 of total time. I thing that using datasources this way leads to large
parformance and memory wasting, doesn't it?
 
Loading a lot of data into List/Combo control is not practical in any
environment - desktop or device. You should re-think your design to display a
minimal required data or imlement data buffering.
 
With 'a lot of data' i mean aboat 200 street's names. In many applications
are used listcontrols with list of all countries an so on.
Maybe expression 'a lot of' is not correct for just 200 records, but when it
takes 2 seconds to add them to combobox?!
environment - desktop or device. You should re-think your design to display a
minimal required data or imlement data buffering.
It that what i would like to do! I would like to ones load data and use them
on diferent places. Mentioned list of streets should be displayed in combobox
and user should have an option to chose something like 'detail' - to display
list in fullscreen mode with search ability. With current DataSource property
implementation, this mean to make at least two copy of absolutely same
data(and although use less memory).

What i am forced to do is to load data into DataTable object insert names
using ListControl.Items.Add method for each record and keep values for each
item in separate array instead of using MemberValue property. That is't realy
nice solution byt it is more than two times faster than assigning DataSource
property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top