Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to get result as "never" from bellow json data
using Newtonsoft.Json
VB 2010

help me :)

{"status":"ok","status_message":"Query was successful","data":{"Go":"Never"}}

What I have tried:

I want to get result as "never" from bellow json data
using Newtonsoft.Json
VB 2010
help me :)

{"status":"ok","status_message":"Query was successful","data":{"Go":"Never"}}
Posted
Updated 14-Sep-19 20:19pm

To use that JSON, you will need appropriate classes in your code:
VB
Public Class Data
    Public Property Go As String
End Class

Public Class RootObject
    Public Property status As String
    Public Property status_message As String
    Public Property data As Data
End Class
With that, you can use the JsonConvert.DeserializeObject Method[^] to process your JSON, and it will "fill in" your data:
VB
Dim MyData As RootObject = JsonConvert.DeserializeObject(Of RootObject)(jsonStringData)
 
Share this answer
 
Comments
OriginalGriff 15-Sep-19 2:18am    
You're welcome!

BTW: Don't use "txtspk" here - you have a keyboard, use it. Typing as little as possible is a bad idea on a site where the better your info, the better the response. And remember, a very large number of our member do not have English as their first language, so txtspk abbreviations may not make any sense at all to them. nowtimn?
In addition to Griff's answer, here is a good article about working with JSON: Working with JSON in C# & VB[^]
It mentions: JSON Utils: Generate C#, VB.Net, SQL Table, Java and PHP from JSON[^]
 
Share this 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