-1

Dear all my brother i have this Json Data enter image description here

0: Object { no: "1", project: "Rosato", job_type: "គ្រឿងសង្ហារឹម", … }
1: Object { no: "2", project: "KPS", job_type: "គ្រឿងសង្ហារឹម", … }

i want to extract it in to c# List or data table please help!

ORN SIVEY
  • 7
  • 2

2 Answers2

-1

Please refer: How to serialize and deserialize (marshal and unmarshal) JSON in .NET

Shawn Xiao
  • 560
  • 5
  • 18
-1

Add Newtonsoft.Json as a reference in your project

string myJsonString = MyMethodToReadJsonAsStringFromDataSource(dataSourceConnection);
IEnumerable<dynamic> myObjects = JsonConvert.DeserializeObject<dynamic>(myJsonString);
foreach(dynamic myObject in myObjects)
{
     // access to your abject
     string no = myObject.no;
     string project = myObject.project;
     string job_type = myObject.job_type;
}

You can replace dynamic with a class you create that maps to your json object so you can have full access to your object at compiler time.

Khaled
  • 317
  • 2
  • 7