JSON Object with Top-Level Entity

149 views
Skip to first unread message

Eric Owsley

unread,
May 24, 2012, 4:41:33 PM5/24/12
to JSON for ASP
I need to format my JSON object using QueryToJSON such that the
resulting data set has a top-level entity. Right now it looks like
this:

[{"ProdID":1,"ProdName":"816 661
120","Accent":"Hammered","Finish":"Gold","Length":6.45}]

I need it to look like the below snippet, with "product" being the top-
level entity.

[{"product": {"ProdID":1,"ProdName":"816 661
120","Accent":"Hammered","Finish":"Gold","Length":6.45}}]

I am generating the JSON by using QueryToJSON(dbconn, sql), where the
variable "sql" is:
"SELECT [ProdID], [ProdName], [Width], [Rabbet], [Accent], [Finish],
[Length] FROM [es_products]"

Thanks for any advice you may provide.

Guillermo Pérez

unread,
May 24, 2012, 5:13:41 PM5/24/12
to asp...@googlegroups.com
????? sorry, I dont remember :(  ??? what's this?? would you please remind me?


> Date: Thu, 24 May 2012 13:41:33 -0700
> Subject: JSON Object with Top-Level Entity
> From: owsleye...@gmail.com
> To: asp...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages