Click here to Skip to main content
15,924,982 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#

my table is
id class Div year feetype amt
name
1 I A 2014-2015 Admission Fees: 100
2 I A 2014-2015 Annual Fees: 200
3 I A 2014-2015 Activity Fees: 300
4 I A 2014-2015 Building Fees: 100
5 I A 2014-2015 Computer Fees: 400
6 I A 2014-2015 Cycle Stand Fees: 100
7 I A 2014-2015 Exam Fees: 900
8 I A 2014-2015 Total: 2100
9 II A 2014-2015 Admission Fees 200
10 II A 2014-2015 Annual Fees: 50
11 II A 2014-2015 Activity Fees: 50
12 II A 2014-2015 Computer Fees: 700
13 II A 2014-2015 Cycle Stand Fees: 800
14 II A 2014-2015 Exam Fees: 100
15 II A 2014-2015 Other Fees: 200
16 II A 2014-2015 Exam-Stationary Fees: 500
17 II A 2014-2015 Term Fees: 600
18 II A 2014-2015 Tution Fees: 5000
19 II A 2014-2015 Total: 8200
and i want op like
classname div year fee1 fee2 fee3 ........total
I A 2014-2015 100 200 300..........600
Posted

1 solution

One possible way would be to get the property names from the object that is mapped to the table using reflection. You could then iterate through each property and value as required.
 
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