Click here to Skip to main content
13,344,765 members (49,805 online)

Comments by Meshack Musundi (Top 3 by date)

Meshack Musundi 27-Dec-16 5:10am View
   
You're getting the error because it can't cast an anonymous type to string. Your results variable should be of type IEnumerable <Anonymous Type> not a string array.
Meshack Musundi 26-Dec-16 12:54pm View
   
You can get a collection of anonymous types by doing,
Dim results = doc...<Locations>.Select(Function(l) New With {.Name = l.@Name, .Type = l.@City})

or
Dim results = doc.Descendants("Locations").Select(Function(l) New With {.Name = l.Attribute("Name").Value, .Type = l.Attribute("City").Value})
Meshack Musundi 15-Jan-14 14:48pm View
   
The arrays you are adding to your list are arrays of Integers so it's a List(Of Integer()) (List of Integer arrays). Note the opening and closing brace after Of Integer.

Advertise | Privacy |
Web03 | 2.8.180111.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid