hi
i am using asp.net 2010
i have a url from where i would be getting the json data
i tried a lot of options but all are using
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
but the prob. is
when i am using
Dim ser As JObject = JObject.Parse(json)
Dim data As List(Of JToken) = ser.Children().ToList
it says : jobject is ambiguous in the namespace newtonsoft.json.linq
same for jtoken and JProperty
it seems Newtonsoft.Json does not support vs 2010
following is the error when i try to upgrade the newtonsoft in package manager
Install-Package : The 'Newtonsoft.Json 12.0.1' package requires NuGet client version '2.12' or above, but the current NuGet version is '2.8.60318.667'.
At line:1 char:2
+ Install-Package Newtonsoft.Json -Version 12.0.1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ([Install-Package], NuGetVersionNotSatisfiedException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
below is the data that i would be getting
it could be failed or informationCode:Failed result: {"failed":0} Success result : { "information": { "1": { "ICMR_no": "22", "name": "abc", "contact_number": "12345", "gender": "Female", "address": "thane1", "age": "2", "health_center": "Health Post - 2", "prabhag_name": "Prabhag - 2", "camp": "Camp 1", "covid_detect_date": "2020-07-16", "patient_status": "positive", "record_date": "2020-07-18 16:44:15" } } }
and in information it could me "n" no of records.
very much confused. pls. guide.
below is the code i have tried
pls. guide. its a bit urgent have spent a lot of time searchingCode:Dim json As String = "http://domainname.in/Clientapi/format_d_details" Dim ser As JObject = JObject.Parse(json) Dim data As List(Of JToken) = ser.Children().ToList Dim output As String = "" For Each item As JProperty In data item.CreateReader() Select Case item.Name Case "failed" ShowMessageNew("No Records Found", "No Data") Case "information" For Each msg As JObject In item.Values Dim drNewRow As DataRow = dTable.NewRow drNewRow.Item("ICMR_no") = msg("ICMR_no") drNewRow.Item("name") = msg("name") drNewRow.Item("contact_number") = msg("contact_number") drNewRow.Item("gender") = msg("gender") drNewRow.Item("address") = msg("address") drNewRow.Item("age") = msg("age") drNewRow.Item("health_center") = msg("health_center") drNewRow.Item("prabhag_name") = msg("prabhag_name") drNewRow.Item("camp") = msg("camp") drNewRow.Item("covid_detect_date") = msg("covid_detect_date") drNewRow.Item("status") = msg("status") drNewRow.Item("record_date") = msg("record_date") drNewRow.Item("GatheredOn") = Format(Today.Date, "dd-MMM-yyyy") dTable.Rows.Add(drNewRow) 'Dim first_name As String = msg("first_name") 'Dim last_name As String = msg("last_name") Next End Select Next dgCases.DataSource = dTable dgCases.DataBind() Session.Add("PositiveCases", dTable) dgCases.DataSource = dTable dgCases.Visible = True dgCases.DataBind()
i am open to even creating a desktop app or web app whatever i am guided to.
thanks a lot




[Install-Package], NuGetVersionNotSatisfiedException
Reply With Quote
