1

Sorry but I'm at a loss. I'm trying to loop the following JSON object using Newtonsoft so that I can process some code

      [{"FirstName":"Andrea","Middlename":"M.","LastName":"Smith"},{"FirstName":"Ronald","Middlename":"E.","LastName":"Jones"}]

What I need is a simple loop that will read the names and send to a database. So I want to

    For  .....
    Dim FirstName as string = 
    Dim Middlename =""
    Dim LastName = ""

    Send to data base FirstName + " " + MiddleName + " " + LastName
    Loop

Thanks for the help and if this is listed somewhere else I have not been able to find it

Bill
  • 1,423
  • 2
  • 27
  • 51

1 Answers1

2

Worked out my own answer. First created a class

       Public Class Person
       Public FirstName As String
       Public MiddleName As String
       Public LastName As String
       End Class

Then

     Dim JObject = JsonConvert.DeserializeObject(Of Person())(JSON)

Then

Looped it

        For i = 0 To JObject.Length - 1
        firstname = JObject(i).FirstName
        Next
Bill
  • 1,423
  • 2
  • 27
  • 51