Click here to Skip to main content
14,456,759 members
Rate this:
Please Sign up or sign in to vote.
I want to fetch data from MS-Access database in window form datagridview based on item selected in checkedlistbox.
I am using OLEDB command to connect databse Not using SQl or Sql connection.
Data in database in string format.

What I have tried:

Label1.Text = "";

for (int c = 0; c < CheckBoxList1.Items.Count; c++)

{

if (CheckBoxList1.Items[c].Selected)

{

Label1.Text += CheckBoxList1.Items[c].Text;


and I am not sure what should i try
Posted
Updated 17-Nov-19 2:09am
v2
Comments
Gerry Schmitz 16-Nov-19 10:22am
   
How did you populate the "checkedlistbox"? Seems like there would be a connection there.
Member 13132705 16-Nov-19 11:04am
   
Yes there is OLEDB connection.
Maciej Los 16-Nov-19 13:08pm
   
Use "Reply" widget to inform other member about your comment.
Member 13132705 16-Nov-19 15:43pm
   
Yes there is OLEDB connection.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Loop through your checkboxes and for each one that is set add the appropriate part of your OLEDB statement.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100