I am trying to serialize data to json so I can send it to a web service. The List Collection worked well until I got over couple ten thousand rows. What is a good collection to use to convert to json so I have the format that I desire and won’t run out of memory if the data gets too large?
[
Items:
{ name: "name", type: "type" }
]
First of all, your data doesn’t need to be in JSON format in order to send it to a Web service.
Second, the type of collection doesn’t really matter. If it’s a
Listorarrayor other, it gets serialized in more or less the same way.Third, do you absolutely require to send thousands of rows in a single call? You might as well call your service multiple times with manageable data chunks.
Finally, if you really need to send such large chunks of data, you may consider ZIPping the data instead of sending it in pure serialized form.
Good luck!