CheckBoxList

G

Guest

Hi

Here is the DB schema

Members tabl
I
nam
InterestID (FK of Interest table

Interest tabl
I
hobbynam

If there are 10 hobbies checkbox for member to select, how can I insert the InterestIDs to Members table?

For radiobuttonlist, I know how to insert as there is only one ID. However, there are many checkbox values for a checkboxlist

I use MS SQL2000 and C#.

Please advise.
 
S

Steve Lutz

Hi Tom,

Your database schema only allows a user to have ONE interest. Unless for
every interest of a user, you have a row in the members table.
If you want a member to have many interests, then you'll need another table:

Members Table:
MemberID (PK)
Name

Interests Table
InterestID (PK)
Name

Member_Interest Table
MemberID (FK)
InterestID (FK)


You need to insert a row into Member_Interest Table for every interest the
user has checked

Hope this helps

Steve



Tom said:
Hi,

Here is the DB schema:

Members table
ID
name
InterestID (FK of Interest table)

Interest table
ID
hobbyname

If there are 10 hobbies checkbox for member to select, how can I insert
the InterestIDs to Members table?
For radiobuttonlist, I know how to insert as there is only one ID.
However, there are many checkbox values for a checkboxlist.
 

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