title: How to extract DataTable from DataSet which is in JSON format
body: <p>I am using Newtonsoft dll for serialization. I am currently returning DataTable from webmethod in Json Format.  And it works fine. But I want to do the same thing by returning DataSet instead of a DataTable. I tried a number of things but none seem to be working.</p>
  
  <pre><code>function GetDropDownData() {
          var myDropDownList = $('.myDropDownLisTId');
  
          $.ajax({
              type: "POST",
              url: "test.aspx/GetDropDownDataWM",
              data: '{name: "abc" }',
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function (data) {
                  $.each(jQuery.parseJSON(data.d), function () {
                      myDropDownList.append($("&lt;option&gt;&lt;/option&gt;").val(this['id']).html(this['name']));
                  });
              },
              failure: function (response) {
                  alert(response.d);
              }
          });
      }
      function OnSuccess(response) {
          console.log(response.d);
          alert(response.d);
      }
  </code></pre>
  
  <p><strong>Json DataTable Returned:</strong></p>
  
  <p><code>[{"name":"sam","id":"1"},{"name":"mark","id":"2"}]</code></p>
  
  <p><strong>Json DataSet Returned:</strong>   </p>
  
  <pre><code> {"patients":[{"name":"sam","id":"1"},{"name":"mark","id":"2"}],"medications":[{"id":"1","medication":"atenolol"},{"id":"2","medication":"amoxicillin"}]}
  </code></pre>
  
  <p><strong>Fiddle</strong>
  <a href="http://jsfiddle.net/8kkg3/306/" rel="nofollow">Demo</a></p>
  
  <p><code>var json=jsonds['patients'];</code> with <code>var json=data['patients'];</code></p>