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

  • Home
  • SEARCH
  • 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 8740519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:08:38+00:00 2026-06-13T11:08:38+00:00

{ "id" : 0, "name" : "meeting", "text" : "10 pm", "location" : "Place1",

  • 0
{
    "id" : 0,
    "name" : "meeting",
    "text" : "10 pm",
    "location" : "Place1",
    "startdate" : "10/27/2012 17:11",
    "enddate" : "10/27/2012 18:41",
    "description" : "Description",
    "chairman" : "0",
    "members" : [2, 1],
    "messagetype" : {
        "SMS" : false,
        "Email" : true
    },
    "smsmessage" : null,
    "emailmessage" : "this is message",
    "emailsubject" : null,
    "reminder" : "5",
    "timetosendemail" : "10/23/2012 00:00",
    "timetosendsms" : null
}

This is my json string. What i need is to parse this string and store each values into specific members of a class.

The class is like this

public class Event
{

    public int id { get; set; }
    public string name {get;set;}
    public string text { get; set; }
    public DateTime start_date { get; set; }
    public DateTime end_date { get; set; }
    public string location { get; set; }
    public double ReminderAlert { get; set; }
    public MessagerType MessageType { get; set; }
    public string SmsMessage { get; set; }
    public string EmailMessage { get; set; }
    public string EmailSubject { get; set; }
    public DateTime TimeToSendEmail { get; set; }
    public DateTime TimeToSendSMS { get; set; }   
    public string[] members {get;set;}
}

I used Json.net library to parse..and my code snippet is given below

var eventValues = JsonConvert.DeserializeObject<List<Dictionary<string, Event>>>(stringEvent);

After running this code i get this error

Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type ‘System.Collections.Generic.List1[System.Collections.Generic.Dictionary2[System.String,CalendarScheduler.Models.Event]]’ because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.

To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.

Path ‘id’, line 1, position 6.

What should be done to avoid this exception…?

  • 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-13T11:08:39+00:00Added an answer on June 13, 2026 at 11:08 am

    This does not work?

    var eventValues = JsonConvert.DeserializeObject<Event>(stringEvent);
    

    And consider Oded’s comment. And match all JSON property names to C# property names.

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

Sidebar

Related Questions

What is the best practice to show text label (e.g. "Name") with the TextBox
I have this simple form: <form method="post" action"."> <input type="text" name="title"> <input type="submit" name"send">
Manifiest.json { "name":"MyExtension", "version":"1.0", "description":"MyExtension Description.", "icons":{"128":"browseraction.png"}, "browser_action": { "default_icon":"icon.png", "default":"Mi default title", "popup":"popup.html"
I'm trying to autocomplete some text-fields with $('#username').replaceWith('<input id=\"username\" type=\"text\" name=\"user_name\">'); $("input#username").autocomplete({ source: ["c++",
I have two entities // All details has been removed @Entity @Table(name = "A_TABLE_NAME")
Do you know of any "JSON Beautifier" for JavaScript? From {"name":"Steve","surname":"Jobs","company":"Apple"} To { "name"
I have next html: <label for="user_name"> <abbr title="required">*</abbr> Name </label> And I want to
Consider: function Shape() { this.name = "Generic"; this.draw = function() { return "Drawing "
I have the typical HTML "contact me" page, i.e. name, e-mail address and message.
I have a database name "CUED" (sqlite Android)it have a table HELLO which contain

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.