troubles creating a List of doubles from a list of objects

Posted by Michel on Stack Overflow See other posts from Stack Overflow or by Michel
Published on 2010-05-20T09:58:27Z Indexed on 2010/05/20 10:00 UTC
Read the original article Hit count: 144

Filed under:
|

Hi,

i have a list with objects. The object has a property 'Sales' which is a string. Now i want to create a list of doubles with the values of all objects' 'Sales' properties.

I tried this: var tmp = from n in e.Result select new{ Convert.ToDouble ( n.Sales) };

but this gives me this error:

Error 106 Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access.

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ