Hi,
I have an json output of the following (ignore the escape characters)
"{\"sEcho\":1,\"iTotalRecords\":10,\"iTotalDisplayRecords\":10,\"aaData\":[{\"Job\":\"developer\",\"Name\":\"kurt\"},{\"Job\":\"plumber\",\"Name\":\"john\"}]}"
which i get from
Person person = new Person();
person.Name = "kurt";
person.Job = "developer";
Person reps2 = new Person();
reps2.Name = "john";
reps2.Job = "plumber";
aa[0] = person;
aa[1] = reps2;
var o = new
{
sEcho = 1,
iTotalRecords = 10,
iTotalDisplayRecords = 10,
aaData = aa
};
string d = JsonConvert.SerializeObject(o);
what I need is;
{"sEcho":1,"iTotalRecords":10,"iTotalDisplayRecords":10,"aaData":["developer","kurt"],["plumber","john"]]
someone got a nifty c# routine that I can pass on object of any kind (e.g. Person, Car, Widget etc) and it will convert it i.e. remove the object fields, curly braces etc or is there some formatting option on the Json which I can't see to do this.
The reason I need to do this is so that I can use the datatable from www.datatables.net which is expecting it in this format
thanks