Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i add array data directly in listbox or combobox

Status
Not open for further replies.

andypower

Programmer
Aug 10, 2004
23
0
0
IN
hello my self avi
i m working in vb and sqlserver
in my customermaster table there is more than 10000 reocrds and when i m going to insert that all records in listbox or combobox it takes too much time to load individual record. how can i directly add all recorts
my code sample

StrSql = ""
StrSql = "Select * From customermaster where
subgroup=29 order by accountname"
RsName.Open StrSql, Conn, adOpenKeyset
cmbHaste.Clear
Do While Not RsName.EOF
cmbHaste.AddItem RsName("Accountname")
RsName.MoveNext
Loop
RsName.Close

here in above i also used recordsets getarray/getstring method it only gives all record in array .tell me any fast and easy method of doing this
 
What the point to load ALL 10000 records in the combo box. Who is going to digest them?
 
Bearing in mind that vladk is making a very valid point, one solution would be to look at one of the data aware comboboxes, which will load straight from the database
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top