zer09 zer09 - 1 year ago 117
C# Question

Couldn't parse json string

I have a json string and tried to parse using json.net but got JsonReaderException (Additional information: After parsing a value an unexpected character was encountered: :. Path 'MedicineQuantityList[0]', line 2, position 8.)

"List": [7,10,14,21,30,50,90,100,200,300],

I am new to json and i am trying to figure it out, how to fix it.

Thank you for any help.

Answer Source

Your JSON format is invalid... Keep in mind that '[' is for arrays.

{"QuantityList":{ "List":[7,10,14,21,30,50,90,100,200,300], "Default":100 }}

Try your JSON samples by converting them on this site: http://convertjson.com/json-to-xml.htm

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download