title: How to retrieve data from the DB for recursively binding a jquery treeview using asp.net mvc
body: <p>I have a table structure like this.</p>
  
  <pre><code>id | Name | ParentId
  </code></pre>
  
  <p>so for example:</p>
  
  <pre><code>id | Name     | ParentId 
  ------------------------- 
  1  | Alice    | 0 
  2  | Bob      | 0 
  3  | Charlie  | 1 
  4  | David    | 2 
  </code></pre>
  
  <p>where 'Alice' and 'Bob' are Parent nodes( which has Id = 0) and Alice has a child node named  'Charlie' and 'Bob' has a child node named 'David'. My question is, I need to retrieve the parent separately and the children in a collection. The 'Children' collection can have multiple parents and its children. Can anyone send me a code snippet using which I can retrieve Data from the database and populate the tree.</p>