Click here to Skip to main content
16,012,316 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi friends
pls i dnt know the first thign about using a checkedlistbox, all have only worked with is a listbox. Now i have a requirement to design a form that has two textboxes which are NameTextbox, and AgeTextbox and a checkedlistbox called AllergyBox, what i want to do is for users to be able to fill their name and age in the textboxes and select their different allergies with the checkedlistbox by checking on any of the items in the checkedlistbox then there is a save button, on click of this button should save the checked items of the checkedlistbox and the value of the textboxes to a table in sql server db. But i dnt know how possible it is to save the textboxes and the checklistbox checked item to the same row in db or should i create another table then use the primary key of one table as the foreign key in the other. Please i just want to be clear with this, and also link me to tutorials about checkedlistbox. Thanks in advance.
Posted

1 solution

You needs to create table as below
1) metadata table which contains all allergy information in detail
2)Patient Details table to same name, age etc.
3) Patient_Allergies table which contains foreign key to both tables and multiple entries for same patient. You can also store more info like from date to date, timestamp if required.

Some useful links

How to bind Check box list,with example[^]
required field validation with checkboxlist[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900