Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1148
  • Last Modified:

adding columns in Listbox

how do I populate two columns in the Listview with Staff Numbers and StaffNames
0
PierreBeukes
Asked:
PierreBeukes
1 Solution
 
mcgantsCommented:
A list box doesn't have two columns, but you could add two columns from a dataset as one list item as follows:

Dim myitem As ListItem

myitem.Text = mydataset.tables(0).rows(0)("StaffNumber") & " " & mydataset.tables(0).rows(0)("StaffNames")
myitem.Text = mydataset.tables(0).rows(0)("StaffNumber")
ListBox1.Items.Add(myitem)

Hope this helps,
mcg
0
 
PierreBeukesAuthor Commented:
I managed to overcome my error thanks.

the answer that mcgants gave also works great.

Thanks.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now