Hi
i get response like this formate
"{\r\n \"SubSurveyNumber\": [\r\n {\r\n \"DistrictLG_Code\": \"Token is Expired!\",\r\n \"SubDistrict\": \"Get New Token.\",\r\n \"VillageCode\": \"\",\r\n \"SurveyNumber\": \"\",\r\n \"SubSurveyNumber\": \"\"\r\n }\r\n ]\r\n}"
GetSubsurveyno customersList1 = JsonConvert.DeserializeObject
//string subsurvey = customersList1.SubSurveyNumber;
int this i got convertion
i wnat to deserilize this data and get mulptple data no only

Aravind GovindarajRank #430 · 5.8K reputationPosted Dec 6, 2022, 6:20 AM EST
Can you please check GetSubsurveyno class.... does it has all the properties which the JSON tag has?
Json :
{
"SubSurveyNumber": [
{
"DistrictLG_Code": "Token is Expired!",
"SubDistrict": "Get New Token.",
"VillageCode": "",
"SurveyNumber": "",
"SubSurveyNumber": ""
}
]
}
Your class should be something like this
public class SubSurveyNumber {
public string DistrictLG_Code { get; set; }
public string SubDistrict { get; set; }
public string VillageCode { get; set; }
public string SurveyNumber { get; set; }
public string SubSurveyNumber { get; set; }
} SubSurveyNumber { get; set; }
public class Application {
public IList
}
Jignesh KumarRank #91 · 22.9K reputationPosted Dec 6, 2022, 11:18 PM EST
Hello,
you need to change your json response, you have sponse name SubSurveyNumber and one property of response also with same name as "SubSurveyNumber" so please change that and create one class with below property then it will work,
public class SubSurveyDetails { public string DistrictLG_Code { get; set; } public string SubDistrict { get; set; } public string SubSurveyNumber { get; set; } public string SurveyNumber { get; set; } public string VillageCode { get; set; } } List response = JavaScriptSerializer().Deserialize>(result);