I am trying to parse an with json net in c#. And i am using json .net
But it is showing the following exception
Error reading JArray from JsonReader. Current JsonReader item is not an array: StartObject. Path '', line 1, position 1.
i am creating json string with jquery. And the example of string is as follows.
{"0":{"tyreId":"","tyreNum":"dsf","tyreSecondHand":"false","tyreReplace":"true"},"1":{"tyreId":"","tyreNum":"gfd","tyreSecondHand":"true","tyreReplace":"true"}}
The JSON document represents an object (JObject
) with the keys "0"
and "1"
. It is not a true array, but rather an object that somewhat mimics an array.
Either read the document as an object, or fix the document to be a real array:
[{"tyreId":"","tyreNum":"dsf","tyreSecondHand":"false","tyreReplace":"true"},{"tyreId":"","tyreNum":"gfd","tyreSecondHand":"true","tyreReplace":"true"}]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With