Problem parsing an array

May 6, 2011 at 1:15 AM

I'm trying to parse this type of array:

[[{"event_timestamp":1304587800,"event_time_8601":"2011-05-05T19:00:00+09:30","event_date":"Thursday, May 5th, 2011","event_time":"7:00 pm","venue_phone":"","event_notes":"","event_id":"2690119","links":[{"link_url":"http:\/\/tickets.sonicliving.com\/event\/2690119\/sl-tickets","link_title":"7:00 pm","link_type":"ticket"}],"event_title":"Justin Bieber","rsvp":"3","venue_id":"83659","venue_name":"Entertainment Centre Adelaide","venue_address":"","lat":"0","lon":"0","poster_url_large":"http:\/\/posters.sonicliving.com\/event\/2690119\/poster.png","poster_url_small":"http:\/\/posters.sonicliving.com\/event\/2690119\/smallposter.png","venue_city":"Adelaide","venue_state":"05","venue_country":"AU","eid":"181570318520944","eids":[0],"facebook_event_url":"http:\/\/www.facebook.com\/event.php?eid=181570318520944"}],[{"event_timestamp":1304766000,"event_time_8601":"2011-05-07T19:00:00+08:00","event_date":"Saturday, May 7th, 2011","event_time":"7:00 pm","venue_phone":"","event_notes":"","event_id":"2690126","links":[{"link_url":"http:\/\/tickets.sonicliving.com\/event\/2690126\/sl-tickets","link_title":"7:00 pm","link_type":"ticket"}],"event_title":"Justin Bieber","rsvp":"0","venue_id":"76921","venue_name":"Burswood Theatre","venue_address":"Great Eastern Highway","lat":"0","lon":"0","poster_url_large":"http:\/\/posters.sonicliving.com\/event\/2690126\/poster.png","poster_url_small":"http:\/\/posters.sonicliving.com\/event\/2690126\/smallposter.png","venue_city":"Perth","venue_state":"08","venue_country":"AU","eid":"173126412708252","eids":[0],"facebook_event_url":"http:\/\/www.facebook.com\/event.php?eid=173126412708252"}]]


I've tried the following code, but all I get is an exception:

Dim jResults As JArray = JArray.Parse(strJResults)

        MessageBox.Show("You have " & jResults.Count & " results")

        For Each jTok As JToken In jResults

            txtResult.Text = txtResult.Text & vbCrLf & jTok.Item("event_date").ToString()
        Next

System.ArgumentException was unhandled
  Message="Accessed JArray values with invalid key value: "event_date". Array position index expected."
  Source="Newtonsoft.Json.Net35"
  StackTrace:
       at Newtonsoft.Json.Linq.JArray.get_Item(Object key) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Linq\JArray.cs:line 187
       at JSONNetTest.frmMain.frmMain_Load(Object sender, EventArgs e) in C:\Users\John Meyer\Documents\Visual Studio 2008\Projects\JSONNetTest\JSONNetTest\frmMain.vb:line 25
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  InnerException:


Any ideas?