Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7961581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:04:55+00:00 2026-06-04T05:04:55+00:00

I am using the Newtonsoft JSon c# plugin. I jave a JArray {data:[{name:Wesley 1,id:616611941},{name:Wesley

  • 0

I am using the Newtonsoft JSon c# plugin. I jave a JArray

{"data":[{"name":"Wesley 1","id":"616611941"},{"name":"Wesley 2","id":"100000138033375"},..............

I was wondering is there a way to loop though each object between the curly braces and extract the name and id of each entry?

Thanks to anyone who can help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:04:57+00:00Added an answer on June 4, 2026 at 5:04 am

    using jQuery you can do this. First loop will go thorough each item in array. second loop will get the key, value in each array item

    $.each(data, function() {
      $.each(this, function(key, value) {
        //do what ever you want
      });
    });
    

    EDIT

    OK. You got some good answers from others. Here is another way.

    namespace

    using System.Web.Script.Serialization;
    

    You add strongly typed class that maps data in the json

    public class wordList
    {
        public List<NameId> data { get; set; }
        public wordList() 
        { 
            data = new List<NameId>(); 
        }
    }
    
    public class NameId
    {
        public string name { get; set; }
        public string id { get; set; }        
    }
    

    then you call

     string jsonObj = @"{""data"":[{""name"":""Wesley 1"",""id"":""616611941""},{""name"":""Wesley 2"",""id"":""100000138033375""}]}";
    
     JavaScriptSerializer jsSer = new JavaScriptSerializer();
     wordList wl = jsSer.Deserialize<wordList>(jsonObj);
    

    You can loop through the WordList to get the name, id values

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Newtonsoft.Json to turn json into objects, that works fine. I was wondering
I'm using Newtonsoft.Json.Linq and I'd like to load the data into objects (or structs)
I'm using Newtonsoft JSON.NET 4.5r7 in an MVC4 non-api project. Below I rename id
I've serialized an object using Newtonsoft's JSON serializer, and the DateTime has come through
Currently I am using the terrific Linq 2 Json.net (by newtonsoft), which is a
Please see: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Newtonsoft.Json; using Newtonsoft.Json.Converters;
I am trying to populate a C# object (ImportedProductCodesContainer) with data using JSON.NET deserialization.
I'm attempting to serialize a class hierarchy in Newtonsoft Json using C#. My class
I'm using the Newtonsoft JSON.NET package to deserialize my responses. This is a sample
I have a working application using Json.NET (newtonsoft) as a custom serializer. Currently I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.