I have the hierarchy of an organization in the SQL database. It looks like this -
Main Manager
Manager - 1
Manager - 1.1
Manager - 1.1.1
Manager - 2
Manager - 2.1
Manager - 2.1.1
Manager - 2.2
etc.
I want to fetch the values in the database and convert to a jquery object just like the example below.
How can I fetch the sql data in the database in hierarchical order and create a jquery object like in the example below?
var data = { Name: "Manager - 1",
ID: "1",
children: [ {
Name: "Manager - 1.1",
ID: "1.1",
children: [ {
Name: "Manager - 1.1.1",
ID: "1.1.1"}
]
Name: "Manager - 1.2",
ID: "1.2",
children: [ {
Name: "Manager - 1.2.1",
ID: "1"}
]
}
]
};
Jaganathan BantheswaranPosted Nov 16, 2013, 9:01 AM
Follow the link for detailed article on EF Navigation Properties with source code
http://weblogs.asp.net/manavi/archive/2011/05/17/associations-in-ef-4-1-code-first-part-6-many-valued-associations.aspx
r pPosted Nov 16, 2013, 7:39 AM
Do you have any example?
Thanks,
Robins
Jaganathan BantheswaranPosted Nov 16, 2013, 7:35 AM
r pPosted Nov 16, 2013, 6:56 AM
I mean I want the best and quickest way.
Jaganathan BantheswaranPosted Nov 16, 2013, 6:50 AM
r pPosted Nov 16, 2013, 4:50 AM
It has fields like - ID, ParentID and Name
Jaganathan BantheswaranPosted Nov 16, 2013, 4:17 AM