title: Fastest way of filling a combobox from a datatable in VB.Net
body: <p>The data table in the following code is filled with 7500-+ records. This all loads quickly from the server. The problem is that it takes a while to loop through the data rows to add them to the combo box. Is there any alternative way of setting the data source of the combo box or a way of speeding this process up?</p>
  
  <pre><code>        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()
  </code></pre>