Skip to content

Instantly share code, notes, and snippets.

@jskeet
Created October 10, 2023 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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