Click here to Skip to main content
15,922,533 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
{
"statuscode":"TXN",
"status":"Transaction Successful",
"data":
{
"APPROVED":[],
"SCREENING":[],
"REQUIRED":[
["1","PAN Card","MANDATORY"]"
["14","Aadhaar Card","MANDATORY"],
["20","GST Registration","OPTIONAL"],
["22","Cancelled Cheque","OPTIONAL"],
["23","Business Address Proof","OPTIONAL"]
]
}
}


What I have tried:

How to convert this type json string in dataset 
Posted
Updated 30-Mar-18 5:52am

So basically what you have is an object in JSON notation. It contains some properties, and information that can be used to parse the object in C# runtime.

{
   "statuscode":"TXN", // string
   "status":"Transaction Successful", // string
   "data": // custom object
   {
      "APPROVED":[], // array
      "SCREENING":[],
      "REQUIRED":
      [
          ["1","PAN Card","MANDATORY"],
          ["14","Aadhaar Card","MANDATORY"],
          ["20","GST Registration","OPTIONAL"],
          ["22","Cancelled Cheque","OPTIONAL"],
          ["23","Business Address Proof","OPTIONAL"]
      ]
   }
}

If you look close enough, you will realize that these are either objects (native, or custom), or they are arrays of types (native or custom). That is how, your JSON converters will parse the data to C# objects. But, you also need to provide a definition to which they are going to parse this into. That is something complex, read my article to learn more about working with JSON in C# language; From zero to hero in JSON with C#[^].
 
Share this answer
 
 
Share this answer
 
Comments
Member 11675009 30-Mar-18 7:56am    
wrong answer

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