Click here to Skip to main content
13,056,442 members (107,865 online)
Rate this:
Please Sign up or sign in to vote.

I am developing a clinical laboratory system project, in which i have added category as: Urine Examination , and etc..
then under this category i add more than one sub category,, and under those subcategories i add more than one tests using primary-foreign keys, Now while generating report, when i select Main category from dropdownlist as Urine Examination, I want that the sub categories under this category will be shown in labels and with those labels i want to show the tests which come under the subcategory. how to retrieve this type of data, multiple data without knowing the number of labels used.
Can anybody Suggest something.

Jasbeer Singh
Posted 25-Feb-13 23:25pm
joshrduncan2012 26-Feb-13 9:14am
What have you tried so far to accomplish this task?

1 solution

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

Solution 2

You need categorized microexpansion & macroexpansion in different table like Main Category and give them any unique ID. Now just reference these ID in your sub-categories table.

You have to use two tables-->

1)Main_Category--> M_ID,M_Name

2)Sub_Category--> S_ID,Name,M_ID

then use the query--> select m.M_NAME,s.S_NAME from Main_Category m,Subcategory s where m.M_ID = s.M_ID and M_Name= 'microexpansion or macroexpansion'

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170728.5 | Last Updated 23 Mar 2016
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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