Click here to Skip to main content
15,037,009 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am new in json.
In my project i need to deserialize json data come from amazon service url .

this is my json  format <a href="">json list</a>

<pre lang="HTML">{"":{"time":"2018-01-02T20:45:46.650Z","type":"Complaint","bounceType":"null","bounceSubType":"null"},

i need to ave this record in db and my db table column's are Email ,type, time,bounceType, bounceSubType.
i am not understand how to do this and this is the link where i get the json json link for details
thanks in advance

What I have tried:

this is i tried

 <pre lang="c#"> using (WebClient wc = new WebClient())
                var json = wc.DownloadString("");
                string jsonData = JsonConvert.SerializeObject(json);
                var _userin = JsonConvert.DeserializeObject(jsonData);


in this code json is Deserialized with tree structure but how to save in DB
Updated 9-Jan-18 4:18am
Dotnet_Dotnet 9-Jan-18 9:51am
for three structure sir you should have nested entity class a properties of a calass contain another class object

1 solution


dynamic _userin = JsonConvert.DeserializeObject(json);
       foreach (var item in _userin)
           string name = item.Name;
           string time = item.Value.time;
           string type = item.Value.type;
           string bounceType = item.Value.bounceType;
           string bounceSubType = item.Value.bounceSubType;

this is one of the method to get the values, have a look on this article [^] by Graeme, you wll find lot on C# JSON
Graeme_Grant 9-Jan-18 10:42am
Karthik_Mahalingam 9-Jan-18 11:30am
Thank you Graeme

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900