How to query some json to select a specific property?
EX: If I have Json obj
like this :
[
{
"grd_symbol":"A+",
"count":21.23,
"code":4,
"name":"X",
"batch_no":760
},
{
"grd_symbol":"A ",
"count":11.93,
"code":4,
"name":"X",
"batch_no":760
},
{
"grd_symbol":"A-",
"count":8.49,
"code":4,
"name":"X",
"batch_no":760
}
]
This's the output of :
string JsonObj = Converter.ConvertDataTabletoString(DT);
public static string ConvertDataTabletoString(DataTable dt)
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
List<Dictionary<string, object>> rows = new List<Dictionary<string, object>>();
Dictionary<string, object> row;
foreach (DataRow dr in dt.Rows)
{
row = new Dictionary<string, object>();
foreach (DataColumn col in dt.Columns)
{
row.Add(col.ColumnName, dr[col]);
}
rows.Add(row);
}
return serializer.Serialize(rows);
}
Now I want to get the count
only,The result will be like this:
[21.23,11.93,8.49]