How to add database values to comboboxes in vb.net

Function for add database values to combobox
=====================================================================================
Public Sub drop_comboboxe ()
ComboBoxvehicle.Items.Clear()
Dim dt As New DataTable
dt = obj.call1("Select tablefieldname from table")
Dim i As Integer = dt.Rows.Count
Dim j As Integer = 0
If i > 0 Then
For j = 0 To i - 1
ComboBoxvehicle.Items.Add(dt.Rows(j)("tablefieldname").ToString
Next
End If
End Sub
=====================================================================================

No comments: