Maik Brauer

Maik Brauer

  • NA
  • 12
  • 43.2k

Read Specific Field from LINQ-Result

Jul 28 2010 8:32 AM
I want to read a special value out from a result which came back from a LINQ Query.

Here a snippet:

var query = from O in result.tbl_UserAuths
                  select O.Status;

foreach (var c in query)
                {
                    Console.Write(c);
                }



As a result there will be:
[0] = 1
[1] = 2
[2] = 3


But I do not want to use always first the foreach loop in order to get all the values.
Is there not a method like: Console.Write(query[1].ToString);
in order to get immediately the value 2 from the Index 1.

Thanks.

Answers (1)