How can I speed up the combobox

  • Thread starter Thread starter Ivan V via DotNetMonster.com
  • Start date Start date
I

Ivan V via DotNetMonster.com

Dear All:

I just wrote a code for the combobox to show a list of supplier name from
the sql server. After running the code, it seems to take a least 6 to 10
seconds to activate the combobox, does anyone knows how to speed up the
process?? Following is the code for it.

kn = New SqlConnection("Data Source=NTSVR4;" & _
"Initial Catalog= cashier; User
ID = newapp; Password= newapp2005;")

com1 = New SqlCommand("Select cus_e_name from customer order by
cus_e_name", kn)
kn.Open()
kr = com1.ExecuteReader(CommandBehavior.CloseConnection)

Do While kr.Read()
u_name.Text = kr("cus_e_name")
u_name.Items.Add(u_name.Text)
Loop

kn.Close()
kr.Close()
 
Ivan V via DotNetMonster.com said:
I just wrote a code for the combobox to show a list of supplier name from
the sql server. After running the code, it seems to take a least 6 to 10
seconds to activate the combobox, does anyone knows how to speed up the
process??

Where/when do you add the items to the combobox? How many items are you
displaying?
 
There are almost 10000 items in there and I add the combo box at the
load_form once the window form pops up.
 

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