Winform- Deserialize json object from a combobox data (loaded from database)

Winform- Deserialize json object from a combobox data (loaded from database)

//using Newtonsoft.Json.Linq;
//using Newtonsoft.Json;

    string jsonStr = "Input Your Json String";
    var parsed = JsonConvert.DeserializeObject<JObject>(jsonStr);
    string[] lst = parsed.Properties().Select(q => q.Name).ToArray();
    comboBox1.Items.AddRange(lst);

Install Newtonsoft.Json package from NuGet. then you can Deserialize your JSON string and add it to your Combobox items

 

2020-02-14