PC Review


Reply
Thread Tools Rate Thread

Bound ComboBox very slow to load

 
 
David D Webb
Guest
Posts: n/a
 
      8th Sep 2004
I am populating several ComboBox's on a page by binding them to a query from
an SQLCE table. The page is very slow to load and flashes in a bad way.
There are 4 dropdowns on the page and each has about 10 items in it. The
table is indexed on the category_id cloumn and I am using the latest service
packs.

I bound them for simplicity so that I could use the SelectedValue property.
Would it help to do this another way? Use a filter on the DataSet or
populate this manually using an SqlCeCommand object and Items.Add()?

Also, since the DataSet is created in a method, am I responsible for any
cleanup on it. I am guessing the ComboBox maintains the reference to it so
it doesn't get disposed until the ComboBox goes away.

Thanks,
Dave


static public void LoadDropdown(int category_id, ComboBox ddLookup, int
selected_id)
{
string sSQL = "SELECT id, descr FROM lookup WHERE category_id = " +
category_id.ToString();
DataSet dsetLookup = new DataSet();
SqlCeDataAdapter daptLookup = new SqlCeDataAdapter(sSQL, Db.conn);
daptLookup.Fill(dsetLookup, "Lookup");
ddLookup.DataSource = dsetLookup.Tables["Lookup"];
ddLookup.DisplayMember = "descr";
ddLookup.ValueMember = "id";
ddLookup.SelectedValue = selected_id;
}


 
Reply With Quote
 
 
 
 
Daimy
Guest
Posts: n/a
 
      9th Sep 2004
Because the first time of using DataSet is slow.


 
Reply With Quote
 
David D Webb
Guest
Posts: n/a
 
      9th Sep 2004
No, not just the first time. Always slow.

"Daimy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Because the first time of using DataSet is slow.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bound combobox j_gold Microsoft Access VBA Modules 6 8th Oct 2009 07:55 PM
Getting the text from a bound combobox. Jim Wooley Microsoft VB .NET 4 30th Jun 2006 10:03 PM
Load dynamic data into comboBox based on input in ComboBox =?Utf-8?B?SmFzb24gU21pdGg=?= Microsoft Dot NET Framework Forms 1 31st May 2004 05:21 AM
Re: Bug: Combobox.dropdown = True during Form.Load event handler causes listbox to be disabled, even though combobox is Enabled. Herfried K. Wagner [MVP] Microsoft Dot NET Framework Forms 0 12th Feb 2004 10:00 PM
Bug: Combobox.dropdown = True during Form.Load event handler causes listbox to be disabled, even though combobox is Enabled. =?Utf-8?B?UmF0a2lsZXk=?= Microsoft Dot NET Framework 0 12th Feb 2004 07:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:40 AM.