How to get record into hierarchy class(parent,child,subchild)
tbl_CountryCountry_ID Country_Name
1 India
2 USA
tbl_State
State_Id State_Name Country_ID
1 State1 2
2 State2 1
3 State3 1
4 State4 2
tbl_District
District_Id District_Name State_Id
1 District1 2
2 District2 1
3 District3 2
4 District5 3
tbl_Pruduct
Product_Id ProductName District_Id
1 Product1 1
2 Product2 1
3 Product3 1
4 Product4 3
5 Product5 4
6 Product6 3
7 Product7 4
tbl_PrudcutDetails
ID ProductType Product_Id Period QTY
1 Rice 1 Jan 16 10
2 Rice 1 Feb 16 11
3 Rice 1 Mar 16 12
4 Rice 1 Apr 16 13
5 Wheat 1 Jan 16 14
6 Wheat 1 Feb 16 15
7 Wheat 1 Mar 16 16
8 Wheat 1 Apr 16 17
9 Wheat 1 May 16 18
10 Rice 2 Jan 16 19
11 Rice 2 Feb 16 20
12 Rice 2 Mar16 21
12 Rice 2 April16 22
12 Rice 2 Aug 16 23
above tables are already there but below output need to get. basically every month data will be display in pivot order based on producttype(Like rice, wheat). if no record for particular month then will be 'o'
ProductType Product Jan16 Feb 16 Mar16 Apr16 May16 June16 July16 Aug16 Sept16 So on for 10 years
Rice Product1 10 11 12 13 0 0 0 0 0
Wheet Product1 14 15 16 17 18 0 0 0 0
Rice Product2 19 20 21 22 0 0 0 23 0
finally i want bind all table records into a class hierarchy using LINQ
Country class ,inside country State class, inside state district class and inside district bind above output table.
please let me know if need any more clarification.
Thanks