Helle Everyone
I modfied the JSON String below by Adding Address. On executing, it gave error.
Additional text found in JSON string after finishing deserializing object. Path '[0].CustomerId', line 3, position 19.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: Newtonsoft.Json.JsonSerializationException: Additional text found in JSON string after finishing deserializing object. Path '[0].CustomerId', line 3, position 19. Source Error:
Line 53: string json = txtJSON.Text.Trim();
Line 54:
Line 55: DataSet dataSet = JsonConvert.DeserializeObject<DataSet>(json);
Line 56: DataTable dataTable = dataSet.Tables["Customers"];
Line 57: ui_grdVw_EmployeeDetail1.DataSource = dataTable;
|
see the string below
[
{
"CustomerId":1,
"Name":"John Hammond",
"Country":"United States",
"Address":"3, Olabisi Close Maryland"
},
{
"CustomerId":2,
"Name":"Mudassar Khan",
"Country":"India",
"Address":"16, Halloway St Bangalore"
},
{
"CustomerId":3,
"Name":"Suzanne Mathews",
"Country":"France",
"Address":"14, Andre Jones Avenue, Nice"
},
{
"CustomerId":4,
"Name":"Robert Schidner",
"Country":"Russia",
"Address":"Vladimar Putin way, Moscow"
}
]