DataTable to JSON

前端 未结 3 1096
悲&欢浪女
悲&欢浪女 2020-11-30 08:00

I recently needed to serialize a datatable to JSON. Where I\'m at we\'re still on .Net 2.0, so I can\'t use the JSON serializer in .Net 3.5. I figured this must have been

相关标签:
3条回答
  • 2020-11-30 08:13

    I found this: http://www.bramstein.com/projects/xsltjson/ You can convert your datatable to xml and use a xslt stylesheet to convert the xml to json.

    It is more a workaround than a real solution.

    0 讨论(0)
  • 2020-11-30 08:24

    Hey budy, its is all here in Rick's blog post Serializing DataTable using Json.NET. He explains in detail how you can accomplish it using Json.NET from James Newton King.

    0 讨论(0)
  • 2020-11-30 08:25

    Would it help you convince your bosses to install a library if it's Microsoft's AJAX extensions for .NET 2.0?

    Included in them is System.Web.Script.Serialization.JavascriptSerializer, which is used in Step 4 of the last link in your post.

    0 讨论(0)
提交回复
热议问题