Getting the error "Newtonsoft.Json.JsonReaderException: Input string '0.0' is not a valid integer. "

Hey there, getting the error as above mentioned when try to desrialize a json object .

var ress = await GetUserDetailsAsync();

        if (!string.IsNullOrEmpty(ress))
            var req = JsonConvert.DeserializeObject<Employee>(ress);

                await DisplayAlert("Success", "HelloOoOooOO", "ok");


using a customize api which have a json response like this,

"Result": [
"COURSE_ID": 105,
"CREATE_DATE": "0001-01-01T00:00:00",
"LAST_UPDATE_DATE": "0001-01-01T00:00:00",
"TEN_ID": 0,
"NAME": "Oracle 12c Database",
"DESCRIPTION": "10g, 11g, 12c, 18c ",
"URL": "",
"EXPIRY_DATE": "0001-01-01T00:00:00",
"DURATION": "5",
"PRICE": 0,
"TERMINATION_DATE": "0001-01-01T00:00:00",
"Task": null
"Message": "SUCCESS",

Best Answer


  • AmitManchandaAmitManchanda USMember ✭✭

    @FaiZii I have tried with your given data and It is working fine for me, May be you are not parsing the json into right type of object.

    I am attaching the console application where I used your json to convert it to an object.

  • FaiZiiFaiZii Member ✭✭

    @AmitManchanda can you please elaborate, or what can i share with you "code" so that you can help me,

  • FaiZiiFaiZii Member ✭✭

    async Task GetUserDetailsAsync()
    var client = new HttpClient();

                var model = new Employee
                var serializedJsonRequest = JsonConvert.SerializeObject(model);
                HttpContent content = new StringContent(serializedJsonRequest, Encoding.UTF8, "application/json");
                HttpResponseMessage response =
                    await client.PostAsync(new Uri(""), content);
                if (response.IsSuccessStatusCode)
                    string result = await response.Content.ReadAsStringAsync();
                    return result;
                    return response.ReasonPhrase;

    This is my code of the api.... where i have the link of the post api to get the data...

    and my Class is

    public class Employee
    public List Result { get; set; }
    public object Message { get; set; }
    public string CODE { get; set; }

    public class Result
        public int COURSE_ID { get; set; }
        public DateTime CREATE_DATE { get; set; }
        public int CREATE_USER { get; set; }
        public DateTime LAST_UPDATE_DATE { get; set; }
        public int LAST_UPDATE_USER { get; set; }
        public int TEN_ID { get; set; }
        public string NAME { get; set; }
        public string DESCRIPTION { get; set; }
        public string PREFERRED_VENDOR { get; set; }
        public string INSTRUCTOR { get; set; }
        public string URL { get; set; }
        public DateTime EXPIRY_DATE { get; set; }
        public string RETRAINING_INTERVEL { get; set; }
        public string DURATION { get; set; }
        public int PRICE { get; set; }
        public string ACTIVE_FLAG { get; set; }
        public DateTime TERMINATION_DATE { get; set; }
        public object Task { get; set; }
  • AmitManchandaAmitManchanda USMember ✭✭
    edited November 2018

    @FaiZii Please have a look on my code, I already implemented it for you there. I used your json

  • FaiZiiFaiZii Member ✭✭

    @AmitManchanda Have a look at my second comment also, i have seen your code you have just read the text in json but i am reading it from the server and getting this error

  • FaiZiiFaiZii Member ✭✭

    Ok , i will try that in a bit, will reply back if it works

Sign In or Register to comment.