CheckedListBox control to Database

G

Guest

anyone could pls help me with CheckedListBox control on a window form...

I have two tables: Person table (PersonID, Name, InterestID(FK)), and Interest table (InterestID, Interest).

I had displayed all vallues from the Interest column in Interest table in a CheckedListBox,
using array and Select SqlCommand. Now, my problem is, how could I record any boxes checked by the user to choose the interests of a person? Then, how could I have checkboxes checked/unchecked depending on the values of InterestID of a person in its table when showing a person's details, then be able to do any changes/updates to its interests by checking/uncheking boxes, then record those changes to the particular person table.

THANKS so much^^.
 
G

Guest

Hi,
anyone could pls help me with CheckedListBox control on a window form...

I have two tables: Person table (PersonID, Name, InterestID(FK)), and Interest table (InterestID, Interest).

I had displayed all vallues from the Interest column in Interest
table in a CheckedListBox,
using array and Select SqlCommand. Now, my problem is, how could
I record any boxes checked by the user to choose the interests
of a person? Then, how could I have checkboxes checked/unchecked
depending on the values of InterestID of a person in its table
when showing a person's details, then be able to do any
changes/updates to its interests by checking/uncheking boxes,
then record those changes to the particular person table.

THANKS so much^^.

Are You sure that Your tables have a suitable structure?

Maybe i'm wrong, but from your description:

1. Single *Person* have single and only single *Interest*.
If that is true then

1.1. view master-detail will be more look like this:
Interest->Person(s)
e.g. for single Interest display list of peoples that
have that Interest

....and conitinue...
e.g. for single Interest display list CheckedListBox of
all Persons with checked only that Persons with selected
Interest

If I'm wrong or I misunderstan You then give me feedback!

Regards

Marcin
 
G

Guest

Dear Marcin

sorry that I didn't explain my problem very well
my problem is actuallt, a single person, with one and more interest
So, when a person detail is shown, a list of interests in a ChekedListBox will be shown
as well as some boxes are checked, showing what are the interests of that particular person shown
Then we may be able to update the person's interests by checking/unchekcing, and hit a save button
Hope this explain more clearly. Thank u for your time and help^^.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top