Get JSON Column Names from ASMX Web Service - json

I'm receiving this JSON from my WebMethod:
{
"TableName": "myTable",
"Table": [
{
"ProdOrder": "245392",
"Item": "C01000FLS0300GF",
"Qty": 40
},
{
"ProdOrder": "245393",
"Item": "C01000FLS0400GF",
"Qty": 20
}
]
}
This is the WebMethod:
<WebMethod()>
Public Function MyWebMethod(strJSON As String) As String
Dim objJSON As Object = New JavaScriptSerializer().Deserialize(Of Object)(strJSON)
'Get TableName
Dim strTableName As String = objJSON("TableName")
'Get Data
Dim arrJSON As Object() = objJSON("Table")
For i As Integer = 0 To arrJSON.Length - 1
Dim ProdOrder As String = arrJSON(i)("ProdOrder")
Dim Item As String = arrJSON(i)("Item")
Dim Qty As String = arrJSON(i)("Qty")
Next
Return "OK"
End Function
Until here all is very simple and it works.
My question now is, how can I get the Names of the fields if I don't know them?
I mean, any way to get "ProdOrder", "Item" and "Qty"...
Using arrJSON(i)("ProdOrder") I get the Value. How can I get the title "ProdOrder"?

I found a way to do it:
Public Function MyWebMethod(strJSON As String) As String
Dim objJSON As Object = New JavaScriptSerializer().Deserialize(Of Object)(strJSON)
Dim strTableName, strFields, strValues As String
For Each JSONItem As KeyValuePair(Of String, Object) In objJSON
Select Case JSONItem.Key
Case "TableName"
'Get TableName
strTableName = JSONItem.Value
Case "Table"
'Get Data
For Each DataRecord As Object In JSONItem.Value
strFields = ""
strValues = ""
For Each DataField As KeyValuePair(Of String, Object) In DataRecord
strFields &= DataField.Key & ","
strValues &= DataField.Value & ","
Next
Next
End Select
Next
Return "OK"
End Function

Related

Accessing an item inside an array

Please see the JSON below, which I have validated using https://jsonlint.com/:
{
"meta": {
"limit": 3,
"count": 3
},
"data": [{
"id": "1",
"MoreInformation": {
"id2": "22"
},
"type": "Person"
},
{
"id": "2",
"MoreInformation": {
"id2": "42"
},
"type": "Person"
},
{
"id": "3",
"MoreInformation": {
"id2": "99"
},
"type": "Person"
}
]
}
Please see the code below:
Module Module1
Sub Main()
Dim json As String = "{""meta"": {""limit"": 2,""count"": 2},""data"": [{""id"": ""1"",""MoreInformation"": {""id2"": ""22""},""type"": ""Person""},{""id"": ""2"",""MoreInformation"": {""id2"": ""42""},""type"": ""Person""},{""id"": ""3"",""MoreInformation"": {""id2"": ""99""},""type"": ""Person""}]}"
Dim jo As JObject = JObject.Parse(json)
Dim a As JArray = CType(jo("data"), JArray)
Dim list As New List(Of Person)
For Each item In a.Children()
Dim itemProperties = item.Children(Of JProperty)()
Dim person As New Person
person.id1 = itemProperties.FirstOrDefault(Function(x) x.Name = "id")
person.id2 = itemProperties.FirstOrDefault(Function(x) x.Name = "id2")
list.Add(person)
Next
End Sub
End Module
Public Class Person
Public Property id1
Public Property id2
End Class
I want the output to be a list of three persons.
The problem is with this line:
person.id2 = itemProperties.FirstOrDefault(Function(x) x.Name = "id2")
It always returns nothing. How can I populate person.id2 with id2 from the JSON?
Update
This works:
Sub Main()
Dim json As String = "{""meta"": {""limit"": 2,""count"": 2},""data"": [{""id"": ""1"",""MoreInformation"": {""id2"": ""22""},""type"": ""Person""},{""id"": ""2"",""MoreInformation"": {""id2"": ""42""},""type"": ""Person""},{""id"": ""3"",""MoreInformation"": {""id2"": ""99""},""type"": ""Person""}]}"
Dim jo As JObject = JObject.Parse(json)
Dim a As JArray = CType(jo("data"), JArray)
Dim list As List(Of Person) = JsonConvert.DeserializeObject(Of List(Of Person))(a.ToString)
Console.WriteLine("got here")
End Sub
providing I change the classes to this:
Public Class Person
Public Property id
Public Property MoreInformation
End Class
Public Class MoreInformation
Public Property id2
End Class
However, I am still intigured how to get the code in my original post working.
I'm not sure if this is the answer you want, but I tried like the code below.
Try
Dim json As String = "{""meta"": {""limit"": 2,""count"": 2},""data"": [{""id"": ""1"",""MoreInformation"": {""id2"": ""22""},""type"": ""Person""},{""id"": ""2"",""MoreInformation"": {""id2"": ""42""},""type"": ""Person""},{""id"": ""3"",""MoreInformation"": {""id2"": ""99""},""type"": ""Person""}]}"
Dim jo As JObject = JObject.Parse(json)
Dim a As JArray = CType(jo("data"), JArray)
Dim list As New List(Of Person)
For Each item In a.Children()
Dim itemProperties = item.Children(Of JProperty)()
Dim itemProperties2 = item.SelectToken("MoreInformation").Children(Of JProperty)()
Dim person As New Person
person.id1 = itemProperties.FirstOrDefault(Function(x) x.Name = "id")
person.id2 = itemProperties2.FirstOrDefault(Function(x) x.Name = "id2")
list.Add(person)
Next
For Each item In list
Debug.WriteLine("id1:" & item.id1.ToString & " id2:" & item.id2.ToString)
Next
Catch ex As Exception
MsgBox(ex.ToString)
End Try

how to filter a specific part of a json string

ive been working on json for about 2 days and its all new to me so im learning as i go i have this string im working with
{
"elements": [{
"id": "123",
"hidden": false,
"name": "testname",
"sku": "1234",
"price": 2499,
"priceType": "FIXED",
"defaultTaxRates": true,
"cost": 1299,
"isRevenue": true,
"stockCount": 0,
"itemStock": {
"item": {
"id": "123"
},
"stockCount": 3,
"quantity": 3.0
},
"modifiedTime": 1504112254000
}],
"href": "http://api.server.com/items"
}
i am usnig the Newtonsoft.Json library
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Imports System.Net
Imports System.IO
Public Class Form1
Dim token = ""
Dim url = "https://api.Server.com/"
Dim mid = ""
Dim parm1 = ""
Dim parm2 = ""
Dim parm3 = ""
Dim parm = parm1 & parm2 & parm3
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim jsonURL As String = url & mid & "/items?" & parm
Dim reader As StreamReader
Dim errorMsg As String = Nothing
Try
Dim request As HttpWebRequest = CType(WebRequest.Create(jsonURL), HttpWebRequest)
request.Headers.Add("Authorization", "Bearer " + token)
Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
reader = New StreamReader(response.GetResponseStream())
Dim jsonStr As String = reader.ReadToEnd()
Dim JsonObject As JObject = JObject.Parse(jsonStr)
Dim jsonArray As JArray = JArray.Parse(JsonObject.SelectToken("elements").ToString)
For Each items As JObject In jsonArray
Dim product As item = JsonConvert.DeserializeObject(Of item)(items.ToString)
idTxtbox.Text = product.id
hiddenTxtbox.Text = product.hidden
nameTxtbox.Text = product.name
skuTxtbox.Text = product.sku
priceTxtbox.Text = product.price
priceTypeTxtbox.Text = product.priceType
defaultTaxRatesTxtbox.Text = product.defaultTaxRates
CostTxtbox.Text = product.cost
isRevenueTxtbox.Text = product.isRevenue
stockCountTxtbox.Text = product.stockCount
For Each itema In product.itemStock
ListBox1.Items.Add(itema("itemStock"))
Next
modifiedTimeTxtbox.Text = product.modifiedTime
MsgBox("")
Next
Catch ex As WebException
errorMsg = "Download failed. The response from the server was: " +
CType(ex.Response, HttpWebResponse).StatusDescription
Console.WriteLine("Error: " + errorMsg)
End Try
End Sub
End Class
Class item
Public id As String
Public hidden As String
Public name As String
Public sku As String
Public price As String
Public priceType As String
Public defaultTaxRates As String
Public cost As String
Public isRevenue As String
Public stockCount As String
'Public itemStock As Dictionary(Of String, String) = New Dictionary(Of String, String)
'Public itemStock As List(Of String) = New List(Of String)
Public Property itemStock() As IList(Of String)
Get
Return m_itemStock
End Get
Set(ByVal value As IList(Of String))
m_itemStock = value
End Set
End Property
Private m_itemStock As IList(Of String)
Public modifiedTime As String
End Class
i can get all the values of the first group of data but cant seems the "stockCount": 3 to show up any idea how i can phrase this?
sorry if im not super clear if you need more info i will try to provide it
i have updated the code of what i have so far i have gotten the JsonConvert.DeserializeObject to work but still cant seem to get the values of
"itemStock": {
"item": {
"id": "123"
},
"stockCount": 3,
"quantity": 3.0
},
to populate in listbox1.items
i receive this error
Cannot deserialize the current JSON object (e.g. {"name":"value"})
into type 'System.Collections.Generic.IList`1[System.String]' because
the type requires a JSON array (e.g. [1,2,3]) to deserialize
correctly. To fix this error either change the JSON to a JSON array
(e.g. [1,2,3]) or change the deserialized type so that it is a normal
.NET type (e.g. not a primitive type like integer, not a collection
type like an array or List) that can be

vb.net Json Error converting value to type

I'm newbie in JSON, I made a first try with a file and it works fine. But my second file gives me headache.
The problem is that the second file start with this : [
my first file was like this
{
"GC": {
"Parameters": {
"feed": "gc",
"lang_code": "fr",
"fmt": "json",
} .................
I try many different things and I always have an error. The error is :
Additional information: Error converting value "person" to type 'JSonPerson'. Path '[0]', line 1, position 9.
Here's the second JSON file text (that start with the bracket "[" :
["person",
[{
"id": "19023",
"player_id": "16493",
"coach_id": "0",
"manager_id": "",
"official_id": ""
},
{
"id": "19024",
"player_id": "16494",
"coach_id": "1",
"manager_id": "",
"official_id": ""
}]]
Now my class:
Public Class JSonPerson
Public person As List(Of JSon_PersonDetail)
End Class
Public Class JSon_PersonDetail
Public id As String
Public player_id As String
Public coach_id As String
Public manager_id As String
Public official_id As String
Public user_id As String
Public first_name As String
Public last_name As String
End Class
And my code (that is the same for the first file, works perfect, but not with the second file):
Dim client As New WebClient()
Dim stream As Stream = client.OpenRead("c:\Global_files\person.json")
Dim reader2 As New StreamReader(stream)
Dim jsonData As String = reader2.ReadToEnd
Dim obj As List(Of JSonPerson)
obj = JsonConvert.DeserializeObject(Of List(Of JSonPerson))(jsonData)
I try this too:
Dim obj As JSonPerson
obj = JsonConvert.DeserializeObject(Of JSonPerson)(jsonData)
But I'm not able to push data inside my class I have errors:
Does someone know what's my problem ?
Update
I also tried reading directly from the stream using a JsonTextReader, like so:
Dim client As New WebClient()
Dim stream As Stream = client.OpenRead("c:Global_files\person.json")
Dim reader2 As New StreamReader(stream)
Dim jsonData As String = reader2.ReadToEnd
Dim reader As New JsonTextReader(reader2)
Dim people As JSonPeople
people = JsonSerializer.CreateDefault().Deserialize(Of JSonPeople)(reader)
reader2 have data. After the variable "reader" is empty. So the people is empty.
Here's the way I did it:
Dim client As New WebClient()
Dim stream As Stream = client.OpenRead("c:\Global_files\person.json")
Dim reader2 As New StreamReader(stream)
Dim jsonData As String = reader2.ReadToEnd
Dim jResults As JArray = JArray.Parse(jsonData)
'Here I know that is the children #1 that I need
Dim Data As List(Of JToken) = jResults.Item(1).Children().ToList
Dim vListOfPerson As New List(Of JSon_PersonDetail)
For Each item In Data
Dim ItemArray As Array = item.ToArray
Dim person As New JSon_PersonDetail
For Each element In ItemArray
Select Case element.name
Case "id"
person.id = element.value
Case "player_id"
person.player_id = element.value
Case "coach_id"
person.coach_id = element.value
Case "manager_id"
person.manager_id = element.value
Case "official_id"
person.official_id = element.value
Case "user_id"
person.user_id = element.value
Case "first_name"
person.first_name = element.value
Case "last_name"
person.last_name = element.value
End Select
Next
vListOfPerson.Add(person)
Next

Deserializing JSON in Visual basic

Basically, I'm trying to parse the comments from a 4chan thread using the 4chan JSON API. https://github.com/4chan/4chan-API
basically, there is one rich text box called input, and another called post_text_box. What im trying to do is make it so that JSON from a 4chan thread entered in the input text box, and comments are extracted from that JSON and displayed in the output text box
however, whenever I try clicking the Go button nothing happens.
Here is my code so far
Imports System.Web.Script.Serialization
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Public Class Form1
Private Sub start_button_Click(sender As Object, e As EventArgs) Handles start_button.Click
Dim j As Object = New JavaScriptSerializer().Deserialize(Of Post)(input.Text)
post_text_box.Text = j.com
End Sub
End Class
Public Class Rootobject
Public Property posts() As Post
End Class
Public Class Post
Public Property no As Integer
Public Property now As String
Public Property name As String
Public Property com As String
Public Property filename As String
Public Property ext As String
Public Property w As Integer
Public Property h As Integer
Public Property tn_w As Integer
Public Property tn_h As Integer
Public Property tim As Long
Public Property time As Integer
Public Property md5 As String
Public Property fsize As Integer
Public Property resto As Integer
Public Property bumplimit As Integer
Public Property imagelimit As Integer
Public Property replies As Integer
Public Property images As Integer
End Class
Since you're importing Newtonsoft.Json, you can just use the JsonConvert.DeserializeObject<T>(String) method:
Dim exampleJson As String = "{ 'no':'123', 'name':'Some Name', 'com':'This is a comment'}"
Dim post As Post = JsonConvert.DeserializeObject(Of Post)(exampleJson)
Dim com As String = post.com
post_text_box.Text = com
Alternatively, if you don't want to create a class for Post, you can use JsonConvert.DeserializeAnonymousType<T>(String, T):
Dim exampleJson As String = "{ 'no':'123', 'name':'Some Name', 'com':'This is a comment'}"
Dim tempPost = New With {Key .com = ""}
Dim post = JsonConvert.DeserializeAnonymousType(exampleJson, tempPost)
Dim com As String = post.com
post_text_box.Text = com
EDIT: It looks like you're getting an array back from the API:
{
"posts" : [{
"no" : 38161812,
"now" : "11\/19\/13(Tue)15:18",
"name" : "Anonymous",
"com" : ‌​ "testing thread for JSON stuff",
"filename" : "a4c",
"ext" : ".png",
"w" : 386,
"h" : 378,
"tn_w" : 250,
"tn_h" : 244,
"tim" ‌​ : 1384892303386,
"time" : 1384892303,
"md5" : "tig\/aNmBqB+zOZY5upx1Fw==",
"fsize" : 6234,
"‌​resto" : 0,
"bumplimit" : 0,
"imagelimit" : 0,
"replies" : 0,
"images" : 0
}
]
}
In that case, you will need to change the type that is being deserialized to Post():
First, add another small wrapper class:
Public Class PostWrapper
Public posts() As Post
End Class
Then adjust your deserialization code:
Dim json As String = input_box.Text
Dim postWrapper = JsonConvert.DeserializeObject(Of PostWrapper)(json) ' Deserialize array of Post objects
Dim posts = postWrapper.posts
If posts.Length = 1 Then ' or whatever condition you prefer
post_text_box.Text = posts(0).com
End If
Instead of needing to define a class, you can deserialize the JSON into an Object, like this:
Dim json As String = "{""items"":[{""Name"":""John"",""Age"":""20"",""Gender"":""Male""},{""Name"":""Tom"",""Age"":""25"",""Gender"":""Male""},{""Name"":""Sally"",""Age"":""30"",""Gender"":""Female""}]}"
Dim jss = New JavaScriptSerializer()
Dim data = jss.Deserialize(Of Object)(json)
Now, as an example, you could loop through the deserialized JSON and build an HTML table, like this:
Dim sb As New StringBuilder()
sb.Append("<table>" & vbLf & "<thead>" & vbLf & "<tr>" & vbLf)
' Build the header based on the keys of the first data item.
For Each key As String In data("items")(0).Keys
sb.AppendFormat("<th>{0}</th>" & vbLf, key)
Next
sb.Append("</tr>" & vbLf & "</thead>" & vbLf & "<tbody>" & vbLf)
For Each item As Dictionary(Of String, Object) In data("items")
sb.Append("<tr>" & vbLf)
For Each val As String In item.Values
sb.AppendFormat(" <td>{0}</td>" & vbLf, val)
Next
Next
sb.Append("</tr>" & vbLf & "</tbody>" & vbLf & "</table>")
Dim myTable As String = sb.ToString()
Disclaimer: I work with C# on a daily basis and this is a C# example using dynamic that was converted to VB.NET, please forgive me if there are any syntax errors with this.
Note:
First you have to install Newtonsoft.Json on nuget console. Then include following code on top of your code.
Imports Newtonsoft.Json
Step:1 Create class with get & set properties.
Public Class Student
Public Property rno() As String
Get
Return m_rno
End Get
Set(value As String)
m_rno = value
End Set
End Property
Private m_rno As String
Public Property name() As String
Get
Return m_name
End Get
Set(value As String)
m_name = value
End Set
End Property
Private m_name As String
Public Property stdsec() As String
Get
Return m_StdSec
End Get
Set(value As String)
m_StdSec = value
End Set
End Property
Private m_stdsec As String
End Class
Step: 2 Create string as a json format and conver as a json object model.
Dim json As String = "{'rno':'09MCA08','name':'Kannadasan Karuppaiah','stdsec':'MCA'}"
Dim stuObj As Student = JsonConvert.DeserializeObject(Of Student)(json)
Step: 3 Just traverses by object.entity name as follows.
MsgBox(stuObj.rno)
MsgBox(stuObj.name)
MsgBox(stuObj.stdsec)
Also, if you have complex json string. If there is subclasses, arrays, etc. in the json string, you can use this way at below. I tried it and it worked for me. I hope it will useful for you.
I accessed root->simpleforecast->forecastday[]->date->hight->celsius,fahrenheit values etc. in the json string.
Dim tempforecast = New With {Key .forecast = New Object}
Dim sFile As String = SimpleTools.RWFile.ReadFile("c:\\testjson\\test.json")
Dim root = JsonConvert.DeserializeAnonymousType(sFile, tempforecast)
Dim tempsimpleforecast = New With {Key .simpleforecast = New Object}
Dim forecast = jsonConvert.DeserializeAnonymousType(root.forecast.ToString(), tempsimpleforecast)
Dim templstforecastday = New With {Key .forecastday = New Object}
Dim simpleforecast = JsonConvert.DeserializeAnonymousType(forecast.simpleforecast.ToString(), templstforecastday)
Dim lstforecastday = simpleforecast.forecastday
For Each jforecastday In lstforecastday
Dim tempDate = New With {Key .date = New Object, .high = New Object, .low = New Object}
Dim forecastday = JsonConvert.DeserializeAnonymousType(jforecastday.ToString(), tempDate)
Dim tempDateDetail = New With {Key .day = "", .month = "", .year = ""}
Dim fcDateDetail = JsonConvert.DeserializeAnonymousType(forecastday.date.ToString(), tempDateDetail)
Weather_Forcast.ForcastDate = fcDateDetail.day.ToString() + "/" + fcDateDetail.month.ToString() + "/" + fcDateDetail.year.ToString()
Dim temphighDetail = New With {Key .celsius = "", .fahrenheit = ""}
Dim highDetail = JsonConvert.DeserializeAnonymousType(forecastday.high.ToString(), temphighDetail)
Dim templowDetail = New With {Key .celsius = "", .fahrenheit = ""}
Dim lowDetail = JsonConvert.DeserializeAnonymousType(forecastday.low.ToString(), templowDetail)
Weather_Forcast.highCelsius = Decimal.Parse(highDetail.celsius.ToString())
Weather_Forcast.lowCelsius = Decimal.Parse(lowDetail.celsius.ToString())
Weather_Forcast.highFahrenheit = Decimal.Parse(lowDetail.fahrenheit.ToString())
Weather_Forcast.lowFahrenheit = Decimal.Parse(lowDetail.fahrenheit.ToString())
Weather_Forcast09_Result.Add(Weather_Forcast)
Next

The given key was not present in the dictionary?

I having trouble deserializing this JSON.
The JSON looks like this:
{
"ticker": {
"high": 91.489,
"low": 88.3,
"avg": 89.8945,
"vol": 233637.9876,
"vol_cur": 2588.09448,
"last": 90.48,
"buy": 90.55,
"sell": 90.48,
"updated": 1372613806,
"server_time": 1372613807
}
}
And my function is this:
Private Function Btce(ByVal Address As String) As String
Dim rt As String = ""
Dim out As String
Dim wRequest As WebRequest
Dim wResponse As WebResponse
Dim SR As StreamReader
Dim Time As Date
Time = Now()
wRequest = WebRequest.Create(Address)
wResponse = wRequest.GetResponse
SR = New StreamReader(wResponse.GetResponseStream)
rt = SR.ReadToEnd
SR.Close()
Dim js As New System.Web.Script.Serialization.JavaScriptSerializer
Dim testObj = js.Deserialize(rt, New Object().GetType())
Dim high = testObj("High")
Dim low = testObj("Low")
Dim avg = testObj("Average")
Dim vol = testObj("Volume")
Dim last = testObj("Last")
Dim buy = testObj("Buy")
Dim sell = testObj("Sell")
out = "Data from btc-e.com" + Environment.NewLine
out += (Time) + Environment.NewLine
out += "High: " + Environment.NewLine
out += "Low: " + Environment.NewLine
out += "Average: " + Environment.NewLine
out += "Volume: " + Environment.NewLine
out += "Last: " + Environment.NewLine
out += "Buy: " + Environment.NewLine
out += "Sell: "
Return out
End Function
Then I get this in the console:
An unhandled exception of type 'System.Collections.Generic.KeyNotFoundException' occurred in Microsoft.VisualBasic.dll
Additional information: The given key was not present in the dictionary.
One of the problems is that you are looking for "Average" in testObj, but in the JSON it is "avg". And you are also looking for "Volume", not "vol".
In addition, the data returned by the deserialization is not a straight collection, it is a System.Collections.Dictionary(Of String, Object) where there is one entry for each of the representing the ticker objects in the json.
Each ticker object contains a String Key and a Value where Value is a System.Collections.Generic.KeyValuePair, which is case-sensitive. Value contains the collection of data (i.e. "high", 9.4189).
Based on this, your code should look like:
Dim js As New System.Web.Script.Serialization.JavaScriptSerializer
Dim cObjects = js.Deserialize(rt, New Object().GetType())
Dim counter As Integer
Dim out As New System.Text.StringBuilder(1000)
' Use a stringbuilder to capture the output; much more efficient than constant string concat
out.Append("Data from btc-e.com").AppendLine()
For Each testObj In cObjects
Dim high = testObj.Value("high")
Dim low = testObj.Value("low")
Dim avg = testObj.Value("avg")
Dim vol = testObj.Value("vol")
Dim last = testObj.Value("last")
Dim buy = testObj.Value("buy")
Dim sell = testObj.Value("sell")
' Since you will be processing multiple records, show something
' in the output about where you are
counter += 1
out.Append("Element ").Append(counter).AppendLine()
out.Append(DateTime.Now).AppendLine()
out.Append("High: ").Append(high).AppendLine()
out.Append("Low: ").Append(low).AppendLine()
out.Append("Average: ").Append(avg).AppendLine()
out.Append("Volume: ").Append(vol).AppendLine()
out.Append("Last: ").Append(last).AppendLine()
out.Append("Buy: ").Append(buy).AppendLine()
out.Append("Sell: ").Append(sell).AppendLine()
Next
Return out.ToString()
When deserializing to an object graph, you can just use DeserializeObject
The keys you are looking for are not present under the object you've just deserialized, but are in fact keys of the object under "ticker".
The default equality comparer used for dictionaries is probably case sensitive. You might want to construct a new dictionary while explicitly specifying StringComparer.***IgnoreCase, where *** is any of Ordinal, InvariantCulture or CurrentCulture.
For example:
Dim testObj = js.Deserialize(Of Dictionary(Of String, Dictionary(Of String, Single)))(rt)("ticker")
testObj = New Dictionary(Of String, Single)(testObj, StringComparer.InvariantCultureIgnoreCase)
Dim high = testObj("High")