title: How to convert c# generic list to json using json.net?
body: <p>I am converting my datatable to c# generic list.</p>
  
  <pre><code> DataTable dt = mydata();
   List&lt;DataRow&gt; list = dt.AsEnumerable().ToList();
  </code></pre>
  
  <p>Now how can i convert this <code>list</code> to json using json.net? Any suggestion.</p>
  
  <p>Sample of json format should be like this,</p>
  
  <pre><code>{"Table" : [{"userid" : "1","name" : "xavyTechnologies","designation" : "",
  "phone" : "9999999999","email" : "test@test.com","role" : "Admin","empId" : "",
   "reportingto" : ""},{"userid" : "2","name" : "chendurpandian","designation" :
   "softwaredeveloper","phone" : "9566643707","email" : "chendur.pandia@gmail.com",
   "role" : "Super User","empId" : "1","reportingto" : "xavyTechnologies"},
  {"userid" : "3","name" : "sabarinathan","designation" : "marketer","phone" :
  "66666666666","email" : "bala3569@gmail.com","role" : "User",
   "empId" : "2","reportingto" : "chendurpandian"}]}
  </code></pre>