Maanik

Maanik

  • NA
  • 1
  • 720

How to get a JSON Format?

Sep 5 2014 5:47 AM
I want to bind a data from table and the output should be in JSON format.
Currently am working in web service, after clicking  my method name it returns the data in JSON Format.
 
Now am getting an output as,
 
[{"ID":1,"STATE_NAMES":"ANDHRA PRADESH"},{"ID":2,"STATE_NAMES":"TAMIL NADU"},{"ID":3,"STATE_NAMES":"KARNATAKA"},{"ID":4,"STATE_NAMES":"KERALA"}]
 
My required output is,
 
{
"States":[
{
"count":4
},
{
"States_list":[
{
"ID":1,
"STATE_NAMES":"ANDHRA PRADESH"
},
{
"ID":2,
"STATE_NAMES":"TAMIL NADU"
},
{
"ID":3,
"STATE_NAMES":"KARNATAKA"
},
{
"ID":4,
"STATE_NAMES":"KERALA"
}
]
}
]
}