Thank you very much Aziz
here is my JSON text :
----
{"Address":{"Address1":"rue Jules Verne","Address2":"Le
Brezet","Country":"France","County":"Puy de
Zôme","Region":"Auvergne","Town":"Clermont-
Ferrand","ZipCode":"63000","ExtendedProperties":[]},"Birthdate":"\/
Date(157762800000)\/","CandidateId":
5614651,"Email":"
pierre...@societe.com","Firstname":"Pierre","MobilePhone":"06
12 34 56 78","Name":"Dupont","Phone":"01 23 45 67 89","Qualification":
{"Code":"232","Title":"Infirmier bloc opératoire","ExtendedProperties":
[]},"Sex":"M","Contacteur":false,"Emailing":true,"Nationality":
{"Code":"FR","Title":"Française","ExtendedProperties":
[]},"ExtendedProperties":[]},{"Address":{"Address1":"rue du
port","Address2":null,"Country":null,"County":null,"Region":null,"Town":"Marseille","ZipCode":"13000","ExtendedProperties":
[]},"Birthdate":"\/Date(150588000000)\/","CandidateId":
2432416,"Email":"
Sophie...@gmail.com","Firstname":"Sophie","MobilePhone":"06
11 34 56 78","Name":"Michel","Phone":"01 22 45 67 89","Qualification":
{"Code":"128","Title":"Kiné","ExtendedProperties":
[]},"Sex":"F","Contacteur":true,"Emailing":false,"Nationality":null,"ExtendedProperties":
[]}
----
I want to parse this text and update the database.
the objective is to recover the value with the name of the column
Can you give me a demo on this example please
On 9 sep, 17:45, Atif Aziz <
aziza...@gmail.com> wrote:
> > but I can not find the methods to parse the text, as the case of xml (eg
> > method: node ...)
> > I tried to convert JSON to XML "JsonConvert.impotr ()" without success.
> > the method is not recognized, knowing that I found in the literature
>
> JsonConvert.Import, without any type specification, will find reasonable
> mappings for JSON values as shown below:
>
> - JSON "null" becomes a null reference
> - JSON "true" or "false" = System.Boolean
> - JSON Number = Jayrock.Json.JsonNumber
> - JSON String = System.String
> - JSON Array = System.Collections.IList
> - JSON Object = System.Collections.IDictionary
>
> So there is *node* concept. When you import a JSON Array or Object value,
> just use it like a an IList or IDictionary as you would in VB 2003.
> Jayrock also directly supports JSON to XML conversion via JsonML. Seehttp://
jsonml.org/to understand the resulting XML and JsonMLCodec in
> Jayrock for more.
> - Atif
>
> > Above all know that I'm French and I have trouble with English [?]
> > Hello
>
> > Above all know that I'm French and I have trouble with English ;-)
>
> > I will come to you to explain my need for a project. NET 1.1
>
> > a Web service sends the JSON text
> > I have to parse the text to insert into the database
> > I make reference to the dll jayrock.Json
> > but I can not find the methods to parse the text, as the case of xml (eg
> > method: node ...)
> > I tried to convert JSON to XML "JsonConvert.impotr ()" without success.
> > the method is not recognized, knowing that I found in the literature
>
> > is what you can give me explanation and examples for good progress in my
> > project?
>
> > Thank you very much
>
> > Nagib ZIOUAR
>
> > 2010/9/8 Atif Aziz <
aziza...@gmail.com>
>
> > Here you go (also available athttp://
gist.github.com/570612):
>
> >> Imports System.IO
> >> Imports Jayrock.Json
>
> >> Module MainModule
>
> >> Sub Main()
>
> >> Dim jsonText As String = _
>
> >> "[""Europe"", ""Asia"", ""Australia"", " _
> >> & """Antarctica"", ""North America"", ""South America"", " _
> >> & """Africa""]"
>
> >> Dim reader As JsonTextReader = New JsonTextReader( _
> >> New StringReader(jsonText))
> >> Try
> >> While reader.Read()
> >> If reader.TokenClass.Equals(JsonTokenClass.String) _
> >> AndAlso reader.Text.StartsWith("A") Then
> >> Console.WriteLine(reader.Text)
> >> End If
> >> End While
> >> Finally
> >> reader.Close()
> >> End Try
>
> >> End Sub
>
> >> End Module
>
> >> On Wed, Sep 8, 2010 at 1:23 PM, Aigle Libre <
nagib.zio...@gmail.com>wrote:
>
> >>> Hello
>
> >>>
vb.net 2003 for a project, I need to parse a JSON file
> >>> do you have any example?
>
> >>> Can you give me the equivalent of this code in
vb.net 1.1 (Visual
> >>> studio 2003) ? :
>
> >>> string jsonText = @"[""Europe"", ""Asia"", ""Australia"",
> >>> ""Antarctica"",
> >>> ""North America"", ""South America"", ""Africa""]";
>
> >>> using (JsonTextReader reader = new JsonTextReader(new
> >>> StringReader(jsonText)))
> >>> {
> >>> while (reader.Read())
> >>> {
> >>> if (reader.TokenClass == JsonTokenClass.String &&
> >>> reader.Text.StartsWith("A"))
> >>> {
> >>> Console.WriteLine(reader.Text);
> >>> }
> >>> }
> >>> }
>
> >>> thank you
>
> > --
> > Cordialement.
> > Nagib ZIOUAR
> > Tel: 06 58 34 68 70
>
>
>
> 330.gif
> < 1 000AfficherTélécharger