-3
Мой код Деятельность:Извлечь массив JSON с помощью WebClient и Json.Net и отобразить его в текстовом режиме?
private void MClient_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e)
{
string json = Encoding.UTF8.GetString(e.Result);
var Details = JsonConvert.DeserializeObject(json);
}
Мой doctor.cs класс код:
namespace App12
{
public class Doctor
{
public string DoctorId { get; set; }
public string doctorName { get; set; }
public string specialityId { get; set; }
public string experiance { get; set; }
public string fee { get; set; }
}
public class RootObject
{
public Doctor doctor { get; set; }
}
}
JSON массив:
{
"0": {
"DoctorId": "1",
"doctorName": "DR.Rama",
"specialityId": "1",
"experiance": "5 years",
"fee": "300rs"
}
}
Я пытаюсь показать это в textview
, но это дает мне ошибку:
System.InvalidCastException: Specified cast is not valid.
спасибо его работы. – shumeza