Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET SQL VB.NET
Hello
 
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.
 
Thank
Jasbeer Singh
Posted 25-Feb-13 23:25pm
Comments
joshrduncan2012 at 26-Feb-13 9:14am
   
What have you tried so far to accomplish this task?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

i have table in database in which values are stored a
 
id cat test val
1. micoexpansion albumin 40
2. microexpanison sugar 20
3. microexpansion jhhj 30
4. macroexpnsion glucose 01
5. macroexpansion hjkh 50
 
when i am displaying this data in gridview
 
after formatting i get like this
 

microexpansion
albumin 40
microexpansion
sugar 20
microexpansion
jhhj 30
macroexpnsion
glucose 01
macroexpansion
hjkh 50
 

but i want oto show like this
 
Microexpansion
albumin 40
sugar 20
jhhj 30
 
macroexpnsion
glucose 01
hjkh 50
 

how can i perform this..
 
Thanks in Advance.
  Permalink  
Rate this: bad
good
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'
  Permalink  

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



Advertise | Privacy | Mobile
Web02 | 2.8.140926.1 | Last Updated 28 Feb 2013
Copyright © CodeProject, 1999-2014
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