Friday, January 8, 2010

My Database Vb 2008 How Can I Convert A Database Column Into A List So I Can Fill A Combobox?

Vb 2008 How can I convert a database column into a list so I can fill a combobox? - my database

I have a drop-down combo box I need to fill with items from my database. However, we must also remove all duplicate entries when you drag on the database, we can not have the DataSource of the ComboBox. Suggestions on how I fill the ComboBox with items from the database?

1 comments:

Pankaj said...

You can use the same basic idea and can be used in your project.
I have it in VB6.0. I called a function as fillcombo (). as --

Private Sub FillCombo ()
RsFill As New ADODB.Recordset
StrFill As String
strFill = ""
StrFill = "Not sub_name some subscription"
If rsFill.State = 1 Then rsFill.Close
cmbname.Clear
strFill rsFill.Open, conn, adOpenKeyset, adLockOptimistic
While rsFill.EOF \\ \\ \\ \\ \\ \\ \\ \\ u0026lt;> True
rsFill cmbname.AddItem! sub_name & ""
rsFill.MoveNext
Wend
End Sub

You can load this function on site.

Post a Comment