In PHP I can do this for example:
while($r = mssql_fetch_assoc($sth)) {
$rowsField["rowsinfo"][] = $r;
}
print json_encode($rowsField);
Which basically returns a (two/multi dimensional I believe) array and returns it in a JSON format.
I am trying to achieve the same thing as I am moving my website to .NET.
So I am trying to do this in a WCF Web Service and so far I have only had success getting this far with Newtonsoft JSON Converter.
I managed to return a DataTable in JSON format but I now need it to return almost like the array like: [["rowsinfo"]{"Address":"15 Tyne Cresent","Name":"John Smith"}] etc...
How can this be achieved? Is it a DataTable I need to return still?
Thanks