Bind data into hierarchy label(Parent--Child--subchild)

Posted by Santosh4u under LINQ on 2/19/2016 | Points: 10 | Views : 364 | Status : [Member] | Replies : 2
tbl_Country
Country_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_ProdutDetails
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 data will 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

) i want above output from tbl_ProdutDetails table
2) how do i bind into multi-label class hierarchy(Country--->State-->District-->ProductionList(Output Class)
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




Responses

Posted by: Rajnilari2015 on: 2/21/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 25

Up
0
Down
@Santosh4u,
Could you please share with us equally what have you tried so far?

That will be helpful

Thanks

--
Thanks & Regards,
RNA Team

Santosh4u, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Amatya on: 2/22/2016 [Member] Silver | Points: 25

Up
0
Down
Share ur SQL Query..

Feel free to share informations 9731764134
mail Id ' adityagupta200@gmail.com
Thanks

Santosh4u, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response