Collection General

C# JSON to DataTable with Example

In this tutorial we create an example for json array to datatable c# using newtonsoft by the simplest method.

I created this example in C# Console Application. Also you can create this example Windows Form, WPF  with DataGridView

 

Firstly, I am using this JSON data in my example: I created this  json data and I saved it custom location

 

In second Step: I added Newtonsoft library in my solution.

 

After Adding Newtonsoft library, I created DataTable, DataRow and I readed JSON data with File.ReadAllText method from custom location

 

Reading step by step cols and rows into DataTable.

 

Reading data from DataTable

 

Here are the all codes:

 

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.