Skip to content

Instantly share code, notes, and snippets.

@jskeet
Created October 10, 2023 18:16
Show Gist options
  • Save jskeet/aed9d9f484440e680f4481018fc37fdf to your computer and use it in GitHub Desktop.
Save jskeet/aed9d9f484440e680f4481018fc37fdf to your computer and use it in GitHub Desktop.
using Newtonsoft.Json;
using System.Data;
var dt = new DataTable
{
Columns = { "id", "name" },
Rows = { { "x", "y" } }
};
string json = JsonConvert.SerializeObject(dt);
Console.WriteLine(json);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment