i'm using checklistbox, i want to display data from sql database in checklistbox with check when particular id number inputted in textbox.

Please Help...I'm new with visual basic...


thanks..

Fetch result from the database.

Dim Adp as New SqlDataAdapter("select col1 from yourtableName","connection_string_here")
Dim Dt as New DataTable
Adp.Fill(Dt)

For Each row As DataRow In Dt.Rows
 CheckedListBox1.Items.Add(row(0))
Next
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.