Binding a CheckedListBox

Posted on 2005-04-20
Last Modified: 2012-05-05
I have a CheckedListBox on my windows form that I would like to bind to a column in my database.

I have created the connection, adapter & dataset and they work fine because I tested in on a datagrid using a dataview. My question is, how can I bind my CheckedListBox to my column. I have tried various methods, but can't get it to populate.

Any ideas?
Question by:Craig_Muckleston
    LVL 25

    Accepted Solution

    this works

    CheckedListBox1.DataSource = ds.Tables(0)
    CheckedListBox1.ValueMember = "id"
    CheckedListBox1.DisplayMember = "mytext"
    LVL 25

    Expert Comment

    "mytext" is the name of the column I wanted to show

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    This is about my first experience with programming Arduino.
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    746 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

    14 Experts available now in Live!

    Get 1:1 Help Now