bevis61

I have an acces db, i have collected the column names and placed them into an array.

i would like to populate a listbox collection with those names.

'//Using ArrayList

Dim columnNameArray As New ArrayList

'Write column names to array

For Each col As DataColumn In Me.Cmm_97v5DataSet.Tables("PARTS").Columns

columnNameArray.Add(col.ColumnName)

Next



Re: Visual Basic Express Edition Populate listbox collection with an array

DMan1

For Each col As DataColumn In Me.Cmm_97v5DataSet.Tables("PARTS").Columns

Me.Listbox1.Items.Add(col.ColumnName)

Next

or if you need the arraylist also then

For Each col As DataColumn In Me.Cmm_97v5DataSet.Tables("PARTS").Columns

columnNameArray.Add(col.ColumnName)

Me.Listbox1.Items.Add(col.ColumnName)

Next