adding columns in Listbox

Posted on 2006-05-17
Last Modified: 2009-07-29
how do I populate two columns in the Listview with Staff Numbers and StaffNames
Question by:PierreBeukes
    LVL 6

    Accepted Solution

    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")

    Hope this helps,
    LVL 3

    Author Comment

    I managed to overcome my error thanks.

    the answer that mcgants gave also works great.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now