Linked Questions
12 questions linked to/from Hierarchical data in Linq - options and performance
9
votes
4
answers
5k
views
Recursive SQL CTE's and Custom Sort Ordering
Image you are creating a DB schema for a threaded discussion board. Is there an efficient way to select a properly sorted list for a given thread? The code I have written works but does not sort the ...
10
votes
2
answers
5k
views
Simulating CTE recursion in C#
Say that have the following CTE that returns the level of some tree data (adjacency model) that I have (taken from Hierarchical data in Linq - options and performance):
WITH hierarchy_cte(id, ...
5
votes
2
answers
6k
views
asp.net MVC database driven navigation menu
can anybody point me in the right direction as to how I would go about implementing a hierarchical navigation menu which is driven by database? I don't want to re-invent the wheel here, so I was ...
2
votes
3
answers
3k
views
Recursive self join
I have table as below. I need to get all the manager id's for the user id provided.
userid managerid
10 1
9 10
6 9
2 6
4 1
If i pass 2 to my method I need to get 1,10,9 and 6. ...
3
votes
1
answer
3k
views
Fill a Recursive Data Structure from a Self-Referential Database Table
This question refers to http://www.matthidinger.com/archive/2009/02/08/asp.net-mvc-recursive-treeview-helper.aspx
Let's say I have a table that looks like this:
(source: matthidinger.com)
And I ...
4
votes
2
answers
2k
views
How to retrieve hierarchical data using Linq-to-entities?
I want to retrieve the data and and display it in sorted (child below it's parent).
The data items defined like this: ID | Title | Parent-ID
What I do is first retrieving all items and then sorting....
1
vote
1
answer
1k
views
Get unknown amount of parents using LINQ to SQL
Given the following:
public class Person
{
public int PersonId { get; set; }
public int? ParentId { get; set; }
}
Suppose I have the following tree structure (PersonID - ParentID):
1 - null
2 ...
1
vote
2
answers
548
views
IQueryable into a hierarchy
I currently have an IQueryable of Questions. In my Question object I have and "id" and a "parentId" which can be used to create a hierarchy. Currently, I bind a RadTreeView to the IQueryable of ...
0
votes
2
answers
400
views
GroupJoin produces very surprising result
I have a database table like shown below:
MenuItemID | int [Primary Key] 1 -----+
MenuItemName | nvarchar(100) |
ParentID | int * -----+...
1
vote
1
answer
356
views
How do I find the root of a hierarchy using LINQ and EF?
I have used the accepted answer to the question Hierarchical data in Linq - options and performance successfully to query a hierarchical table for all descendants of a particular record/node. Now I ...
1
vote
1
answer
238
views
Return category hierarchy in a string like "cat1 > cat2 > cat3"
I have an SQL table in the following format:
id categoryname parent id
1 cat1 0
2 cat2 1
3 cat3 2
4 cat4 0
5 cat5 ...
0
votes
1
answer
228
views
Iterations and array in T-Sql
Let's say I have this class Location, which represents locations.
public class Location
{
public int LocationID { get; set; }
public int JuridictionID { get; set; }
public int LocationName { ...