Unless C# inference is not the same as VB.NET e.Value should be a
string, so the .ToList() should produce a List<string> automatically.
I.e. I don't see why you need to explicitly cast it to that.

-- 
Regards,
Mark Hurd, B.Sc.(Ma.)(Hons.)

On 22 November 2010 10:23, King, Michael <[email protected]> wrote:
> Thanks Mark,
>
> (I worked an early shift on Friday so had left before your response came 
> through).
>
> Your answer was spot on - only very minor tweaking required - this is the 
> final solution which is working a treat:
>
> (List<string>)partElem.Elements("stores").Select((e) => e.Value).ToList()
>
> Thanks for your help.
>
> Michael King
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On 
> Behalf Of Mark Hurd
> Sent: Friday, 19 November 2010 1:35 PM
> To: ozDotNet
> Subject: Re: XML problem reading "sub elements"
>
> Hopefully you've solved it yourself by now, but you need to use
> partElem.Elements("stores").Select((e)=>e.Value).ToList or something
> similar. (NB I don't use C# day to day, so I may have that
> syntactically incorrect, but you should get the idea.)
>
> --
> Regards,
> Mark Hurd, B.Sc.(Ma.)(Hons.)
>

Reply via email to