In my asp.net application , I have to pass data in xml format to stored procedure.
The data which I have is in format of Json as below:
{
"total": 10,
"page": 1,
"records": 100,
"rows": [
{
"id": 0,
"cell": [
"217121",
"1001",
"CAMRY",
"2532",
"2532",
"0",
"36",
"8",
"13",
"0.03",
"0.15",
"0.15",
"0.10",
"0.14"
]
},
{
"id": 1,
"cell": [
"217121",
"1001",
"CAMRY",
"2540",
"2540",
"0",
"6",
"18",
"13",
"0.29",
"0.14",
"0.14",
"0.21",
"0.27"
]
},
{
"id": 2,
"cell": [
"217121",
"1001",
"CAMRY",
"2546",
"2546",
"0",
"9",
"3",
"5",
"0.13",
"0.35",
"0.35",
"0.24",
"-0.32"
]
},
{
"id": 3,
"cell": [
"217121",
"1001",
"CAMRY",
"2548",
"2548",
"0",
"29",
"8",
"14",
"0.30",
"0.16",
"0.16",
"0.23",
"-0.41"
]
},
{
"id": 4,
"cell": [
"217121",
"1001",
"CAMRY",
"2550",
"2550",
"0",
"31",
"17",
"7",
"0.12",
"0.10",
"0.10",
"0.11",
"-0.14"
]
},
{
"id": 5,
"cell": [
"217121",
"1001",
"CAMRY",
"2554",
"2554",
"0",
"20",
"37",
"3",
"0.13",
"0.10",
"0.10",
"0.11",
"-0.62"
]
}
]
}
In my button click I want to parse this and convert this to xml. I am using namespace
using Newtonsoft.Json.Linq;
And used following code,
protected void TEST_Click(object sender, EventArgs e)
{
var modelJson = hdnModelObject.Value;
var obj=JObject.Parse(modelJson);
}
But not sure how to loop it. stuck in this line. Will be great if any suggessions. Regards