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 8697663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:34:41+00:00 2026-06-13T01:34:41+00:00

I am trying to deserialize the json string in C#. Following is jsonstring and

  • 0

I am trying to deserialize the json string in C#. Following is jsonstring and classes I used. But after deserialize it is giving null value. So what’s going wrong with me?

 string jsonString = @"{'status':1,'data':[{'report_date':'2012-10-16','subid':'000ebc7d-d9fc-4822-923e-c7ac6027f5cd','revenue':'0.00','clicks':'0'},{'report_date':'2012-10-16','subid':'0013eeb2-54e3-4ef1-9fff-9bc5c146858e','revenue':'0.00','clicks':'0'},{'report_date':'2012-10-16','subid':'002c3efc-cf82-466e-a94b-994f548c27fc','revenue':'0.00','clicks':'0'},{'report_date':'2012-10-16','subid':'003bac5b-81a7-4042-8e4c-b882c4d31534','revenue':'0.00','clicks':'0'},{'report_date':'2012-10-16','subid':'00626129-c888-45c0-8401-c44f64d0e1c2','revenue':'0.00','clicks':'0'},{'report_date':'2012-10-16','subid':'007da905-e053-48e5-800a-9815d3da6a34','revenue':'0.00','clicks':'0'},{'report_date':'2012-10-16','subid':'ff8011fb-0dfd-4336-b3f3-0a915100767d','revenue':'0.00','clicks':'0'},{'report_date':'2012-10-16','subid':'ff855a9e-3f39-48fd-b27b-5eb15221acbd','revenue':'0.00','clicks':'0'}],'messages':[],'errors':[],'code':200,'time':{'click':1350456414}}";



     System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
     PM.AdknowledgeRevenue.Entities.RevenueList collection = serializer.Deserialize<PM.AdknowledgeRevenue.Entities.RevenueList>(jsonString);

Classes i used

     public class Revenue
        {
            #region private members
            string _reportDate; 
            Guid subId; 
            Decimal revenue; 
            int clicks;
            int status;


            #endregion

            #region public members
            public int Status
            {
                get { return status; }
                set { status = value; }
            }
            public string ReportDate
            {
                get { return _reportDate; }
                set { _reportDate = value; }
            }
            public Guid SubId
            {
                get { return subId; }
                set { subId = value; }
            }
            public Decimal Revenue1
            {
                get { return revenue; }
                set { revenue = value; }
            }
            public int Clicks
            {
                get { return clicks; }
                set { clicks = value; }
            }
            #endregion
     }

    public class RevenueList
   {
     public IEnumerable<Revenue> RevenueCollection { get; set; }
   }

Thanks in advance

  • 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-13T01:34:42+00:00Added an answer on June 13, 2026 at 1:34 am

    Below code works..

    var result = new JavaScriptSerializer().Deserialize<Result>(jsonString);
    
    public class Result
    {
        public int status;
        public List<Item> data;
    }
    
    public class Item
    {
        public string report_date;
        public string subid;
        public string revenue;
        public string clicks;
    }
    

    or using Json.Net

    var result = JsonConvert.DeserializeObject<Result>(jsonString);
    
    public class Result
    {
        [JsonProperty("status")]
        public int Status;
        [JsonProperty("data")]
        public List<Item> Data;
    }
    
    public class Item
    {
        [JsonProperty("report_date")]
        public string ReportDate;
        [JsonProperty("subid")]
        public string SubId;
        [JsonProperty("revenue")]
        public string Revenue;
        [JsonProperty("clicks")]
        public string Clicks;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to deserialize a JSON string with the following syntax into C# classes,
i'm trying to deserialize a json string pulled from the web using json.net, but
I'm trying to deserialize the JSON string [{ key : 1, value : open},
I am trying to deserialize a JSON string into a class instance in Haxe.
I'm new with JSON.NET and I'm trying to deserialize a JSON string to a
I am trying to serialize/deserialize JSON in Android using GSON. I have two classes
I'm trying to create two method to serialize/deserialize classes using Json.Net and save/load them
I am trying to deserialize a JSON string using VB.net and cannot seem to
I am trying to deserialize a JSON string that was serialized by JSON.Net 4.0
i'm trying to deserialize a json string into a new list on C# using

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.