以下代码中的数据表填充了 7500-+ 条记录。这一切都从服务器快速加载。问题是循环遍历数据行以将它们添加到组合框需要一段时间。有没有其他方法可以设置组合框的数据源或加快这个过程?
Dim dtColours As New DataTable
Dim daColours As New SqlDataAdapter
Dim i As Integer
ConnectToSQL()
daColours = New SqlDataAdapter("SELECT DISTINCT Rtrim(UPPER(Colour)) As Colour FROM invStockColour WHERE InUse = 1 ORDER BY Colour", dbSQL)
daColours.Fill(dtColours)
For i = 0 To dtColours.Rows.Count - 1
cboColours.Items.Add(dtColours.Rows(i).Item(0).ToString)
Next
dbSQL.Close()