title: JSON object to Datatable in C#
body: <p>I've the following c# Class</p>
  
  <pre><code>public class Output
          {
              public string name { get; set; }
              public string[] results { get; set; }
          }
  </code></pre>
  
  <p>Which results in below output after execution</p>
  
  <pre><code>[
    {
      "name": "Field1",
      "results": [
        "One",
        "Two",
        "Three"
      ]
    },
    {
      "name": "Field2",
      "results": [
        "One",
        "Two",
        "Three",
        "Four"
      ]
    }
  ]
  </code></pre>
  
  <p>Is there any utility or library which can convert my JSON into DataTable. I checked the <a href="https://stackoverflow.com/questions/7641004/how-to-convert-json-into-datatable">JSON.net example</a> but that require the JSON must be in below format to convert that into table</p>
  
  <pre><code>string json = @"[{"Field1" : "One", "Field2": "One"}
  {"Field1" : "Two", "Field2": "Two"}
  {"Field1" : "Three", "Field2": "Three"}
  {"Field1" : "", "Field2": "Four"}];
  
  var table = JsonConvert.DeserializeObject&lt;DataTable&gt;(json);
  </code></pre>
  
  <p>Also, Any clue if my JSON can be converted in the format needs for JsonConvert.DeserializeObject</p>
  
  <p>It's not duplicate, the question marked in duplicate discusses the best way instead the complex JSON format example i provided here.</p>
  
  <p><strong>Expected Output</strong></p>
  
  <pre><code>Field1,  Field2
  One, One
  Two, Two
  Three, Three
  null,Four
  </code></pre>