tags:

views:

86

answers:

1
+3  A: 

Just loop over your list - the anonymous type is anonymous - but still a strict type! You can get intellisense and should be able to access the fields Country and CountryID with no problem at all:

foreach(var c in yourListOfCountries)
{
   string countryName = c.Country;
   int countryID = c.CountryID;
}

Marc

marc_s
I thought that anonymous types handled from a different way.As I saw I could also use LINQ.Thanks marc_s.
StrouMfios
No, there's nothing special about anonymous types - other than the fact *you* as a developer don't know their type name. But there **is** a full type definition behind them and you can use them just as absolutely normal types.
marc_s
And PS: if you liked my answer and it solved (or helped to solve) your problem, please be so kind as to **accept** it - it's the polite thing to do on Stackoverflow. See: http://meta.stackoverflow.com/questions/5234/accepting-answers-what-is-it-all-about
marc_s