vb Code:
'write this code in form load event 'this code is to load the fields from your database Dim con As New OleDb.OleDbConnection("type your connection string") Dim dt As New DataTable Dim qry As String = "select * from tablename" Dim da As New OleDb.OleDbDataAdapter(qry, con) Dim ret As Integer = da.Fill(dt) ComboBox1.Items.Clear() If ret > 0 Then For i As Integer = 0 To ret - 1 ComboBox1.Items.Add(dt.Rows(i).Item("fieldname") Next End If 'write this code to add new items in your combobox ComboBox1.Items.Add("Item1")




Reply With Quote