Re: Populating a combo from a database table faster
- From: "Adem" <adembaba@xxxxxxxxxx>
- Date: 30 Mar 2006 00:30:05 -0700
<tglunz@xxxxxxxxxxxxxxxxxxxxx> wrote:
I was wondering if anyone know a faster way to populate a combo?
This is the first thing you should do:
Combo.items.BeginUpdate;
try
Combo.items.clear;
CodeQuery.First; // ADO dataset
while not CodeQuery.Eof do begin
Combo.Items.Add(CodeQuery.Fields[0].AsString);
CodeQuery.Next;
end;
finally
Combo.items.EndUpdate;
end;
This should speed things up significantly.
If that isn't enough, you could try virtual-data approach,
but I doubt if it will help much since you're going to be
accessing an ADO Dataset which is not (by design) fast for
incremental access.
.
- Follow-Ups:
- References:
- Populating a combo from a database table faster
- From: tglunz
- Populating a combo from a database table faster
- Prev by Date: Re: HTML parser component help
- Next by Date: Re: Populating a combo from a database table faster
- Previous by thread: Re: Populating a combo from a database table faster
- Next by thread: Re: Populating a combo from a database table faster
- Index(es):