Combo box binding slow - vb.net
Posted on 2005-03-01
My vb.net application is working very slow while binding combo box.
I am using the following code
Dim dsCompany As New DataSet
Dim daCompany As SqlDataAdapter
conBncclient = New SqlConnection(objbncClient.conClient)
daCompany = New SqlDataAdapter("SELECT companycode,companyname from qry_syncompanymain order by companyname", conBncclient)
If dsCompany.Tables(0).Rows.Count > 0 Then
cbCompanyname.DataSource = dsCompany.Tables("dtCompany")
cbCompanyname.DisplayMember = "companyname"
cbCompanyname.ValueMember = "companycode"
cbCompanyname.SelectedIndex = -1
Am i doing anything wrong?. There are around 8000 records in the table and it takes 4-5 seconds to bind the combo box.