Simple loop

Oct 25, 2010 at 7:12 PM


I'm attempting to do a simple loop through a collection of JSON objects.    I have a string that contains raw JSON data (a list of users and their info).  How would I use your library to best loop through the results and look at each object in the collection individually?  Once I have the objects separated into individual chunks of JSON data, how do I access the attributes of each JSON sub object?

We don't use LINQ in our application anywhere so if there is a method of doing this without LINQ, please supply it.  Otherwise, can you point me in the right direction?





Oct 25, 2010 at 7:36 PM

I'm working w/ Ryan.  Please allow me to provide a few more details on what we're trying to do.


The JSON data has two sections.  The first part is just a status code: 


We know how to deal w/ that, no problem.


The 2nd part is an arry of information about users: 



There are several pieces of information about each user (ID, name, etc.)  We know how to get the ID, name, etc. for the first user using SelectToken.  However, we can't figure out how many users' data are in the array (so we can loop through them with a for loop) or just get a list of the objects so we can iterate through w/ a foreach.

Any tips would be greatly appreciated.

Oct 25, 2010 at 10:11 PM

I figured this out.

In hopes that our solution will be helpful for others, I'll try to post more tomorrow.