I have C# DataTable in the following format:
DataTable convert to JSON Format
- ID | ParetCode|ChildCode| AttName | AttCode|
- -------------------------------------------------
- 01 | 01 | 001 | att1 | 3 |
- 02 | 01 | 001 | att2 | 456 |
- 03 | 01 | 002 | att1 | 87 |
- 04 | 01 | 002 | att0 | 65 |
- 05 | 02 | 054 | att1 | 54654|
How can I convert that into a Json object as follows?
- [
- {"id":"01","ParentCode":"01","ChildCode":001
- {"AttName":"att1",
"AttCode":3, - "AttName":"att2",
"AttCode":456, - },
"ChildCode":002 - {
- "AttName":"att1",
"AttCode":87, - "AttName":"att0",
"AttCode":65 - }
- {"id":"05","ParentCode":"02","ChildCode":054
- {"AttName":"att1",
- "AttCode":"54654"
- }
- }
- ]

Vishal JadavPosted Aug 29, 2016, 10:20 AM
Vinay SinghPosted Aug 29, 2016, 8:14 AM
Vasanth NatarajanPosted Aug 29, 2016, 8:09 AM
ketan borsdiyaPosted Aug 29, 2016, 4:32 AM
Rajeesh MenothPosted Aug 29, 2016, 3:24 AM
Manas MohapatraPosted Aug 29, 2016, 2:59 AM