title: ASP.Net : DataTable convert to JSON with Hierarchy
body: <p>Hi I'm having a problem in converting my dataTable to JSON format but i cannot get the output that i want.</p>
  
  <p>Here is the example of the datatable</p>
  
  <pre><code> Parent        Child
     P1           c1
     P1           c2
     P1           c3
     P2           c4
  </code></pre>
  
  <p>the output that I need is:</p>
  
  <pre><code> [{
      Parent:P1,
      Child:[
              {c1},
              {c2},
              {c3}
             ]
   },
   {
      Parent:P2
      Child:[{c4}]
   }] 
  </code></pre>
  
  <p>But the Output that i always get is:</p>
  
  <pre><code>    [{Parent:P1, Child:c1}, {Parent:P1, Child:c2}, {Parent:P1, Child:c3}, {Parent:P2,
             Child:c4}]
  </code></pre>