How to parse a JSONString To Dataset?

后端 未结 6 1691
我寻月下人不归
我寻月下人不归 2020-12-03 15:38

I am creating a C# Application using Web Services. In my Web Services I\'m using a JSONString data. But I\'m not able to convert this string into a DataSe

6条回答
  •  时光说笑
    2020-12-03 16:27

    I prefer you follow Nick's suggestion... and perhaps your web services should modified because I saw similar property on each Table and Table1 and property inside...

    1. Create class using json2csharp.com and I got this

      public class Table
      {
          public string DisplayVoucherNumber { get; set; }
          public string ActualDate { get; set; }
          public string AccountName { get; set; }
          public string NetWeight { get; set; }
          public string Weight { get; set; }
          public string Pcs { get; set; }
          public string Difference { get; set; }
      }
      
    2. Deserialize json string using
      List

      list = JsonConvert.DeserializeObject>(jsonstring);

    3. You can access that list object to put on your DataSet.
    4. 提交回复
      热议问题