TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ekrem Tapan
NA
967
81k
DataTable convert to JSON Format
Aug 29 2016 2:45 AM
I have C# DataTable in the following 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"
}
}
]
Reply
Answers (
6
)
how to stop refreshing contents of master page in asp.net
How to marge to sp result in MVC???