473,387 Members | 1,664 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How can I speed up the combobox


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()
--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #1
2 1457
"Ivan V via DotNetMonster.com" <fo***@DotNetMonster.com> schrieb:
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?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

There are almost 10000 items in there and I add the combo box at the
load_form once the window form pops up.

Herfried K. Wagner [MVP] wrote:
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?

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...b-net/200507/1
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Mr. B | last post by:
Here's the situation... You've a combobox with Items already added. Say they look like this (or even lines of text): 10-00-232 10-00-256 10-01-006 10-01-213 10-02-200
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
1
by: anonymous | last post by:
I've been trying to put a them, please help me out. Here's the major parts of my code: public Form1() { DataSet myDataSet = new DataSet("myDataSet"); DataTable testTable = new...
3
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article:...
2
by: Don | last post by:
I've looked high and low for some code that will allow me to have a combobox with a flat borderstyle. I found a few examples, but nothing that was really usable for me. I had the following...
8
by: **Developer** | last post by:
I have a ListView that has about 200 rows and 15 columns. When I execute "Sort" it takes minutes to sort. I did implement my own ICompare object but the Function Compare is simple, much like the...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
0
by: eselk | last post by:
I'm using Access 2000. I've got a basic look-up combobox on a form (moves to selected record on update). The key field and the look-up field are both indexed, and the speed if fast enough for me....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.