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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:08:24+00:00 2026-05-26T03:08:24+00:00

I am new to Silverlight and .net architecture. I am working on a Windows

  • 0

I am new to Silverlight and .net architecture. I am working on a Windows Phone 7 project.
where i receive some JSON format data from the server.
I receive the data from the server ine the callback of webClient interface.
however i am not able to de serialize the data in c# objects.
I am using following code

public void GetData_Completed(object sender, DownloadStringCompletedEventArgs e)
    {

        byte[] encodedString = Encoding.UTF8.GetBytes(e.Result);

        //// Put the byte array into a stream and rewind it to the beginning
        MemoryStream ms = new MemoryStream(encodedString);
        ms.Flush();
        ms.Position = 0;

        // convert json result to model
        Stream stream = ms;
        DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(SchedulesResults));
        SchedulesResults myResults =
        (SchedulesResults)dataContractJsonSerializer.ReadObject(stream);

        var result = myResults;
    }

the data format that i am supposed to get is like this

schedules: [
    {
        id: 2897
        progress: -9
        state: complete
        starts_at: 1315267800
        primary_topic: {
            id: 13
        }
        secondary_topic: {
            id: 9
        }
        scores: [
            {
            schedule_id: 2897
            score: 0
            topic_id: 13
            }
            {
            schedule_id: 2897
            score: 4
            topic_id: 9
            }
        ]
    }
    .
    .
    .

and this is the class that i am using to de serilaize

public class SchedulesResults
{

    /// <summary>
    /// Gets or sets the results.
    /// </summary>
    /// <value>The results.</value>
    public Schedules[] results { get; set; }
}

public class Schedules
{
   int id { get; set; }
   int progress { get; set; }
   string state { get; set; }
   DateTime starts_at { get; set; }
   primary_topic primary_topic_ID { get; set; }
   secondry_topic secondary_topic_ID { get; set; }
   Scores[] scores { get; set; }

}
public class primary_topic
{
    int id { get; set; }
}

public class secondry_topic
{
    int id { get; set; }
}

public class Scores
{           
      int schedule_id{ get; set; }
      int score { get; set; }
      int topic_id { get; set; }

}

but on de serializing i am getting null in the value.
please tell me where i might be going wrong.

This is the type of data i am getting from server

{"schedules":[{"id":3499,"progress":-9,"state":"complete","starts_at":1317945600,"primary_topic":{"id":6},"secondary_topic":{"id":11},"scores":[{"schedule_id":3499,"score":2,"topic_id":6},{"schedule_id":3499,"score":3,"topic_id":11}]},
  • 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-05-26T03:08:24+00:00Added an answer on May 26, 2026 at 3:08 am

    Looks to me like the property in ScheduleResults should be schedules, not results.


    I mean this:

    public class SchedulesResults 
    { 
    
        /// <summary> 
        /// Gets or sets the results. 
        /// </summary> 
        /// <value>The results.</value> 
        public Schedules[] results { get; set; } 
    } 
    

    Should be this:

    public class SchedulesResults 
    { 
    
        /// <summary> 
        /// Gets or sets the results. 
        /// </summary> 
        /// <value>The results.</value> 
        public Schedules[] schedules { get; set; } 
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Silverlight. In Silverlight, we can get data from server using
Issue: When creating a new SilverLight Application Project from Visual Studio 2010, the SilverLight
I'm new to .net programming in general and windows phone 7 specifically (I'm a
I am new with Silverlight and I can get the data from my database
I'm new to silverlight and I'm porting from asp.net 2.0. I have done many
I can create new Silverlight App with .NET RIA Services enabled. But when I
I'm starting a new Silverlight project at the moment, and I'm having issues where
I'm new in Silverlight and i am doing some tests. With my current test
I am new in silverlight .. unlike windows form ,I am unable to find
I'm pretty new to Silverlight/RIA/Asp.Net thing, and I'm trying to figure if an Asp.Net

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.