CSharp examples for LINQ:Select
Select from a collection
using System;//from ww w . j a v a 2 s . c o m using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using System.Data; class MainClass { static void Main(string[] args) { ICollection<string> collection = new List<string>() { "Oracle", "MySQL", "C", "fig", "XML", "file", "PLSQL" }; IEnumerable<string> collEnum = from e in collection select e; foreach (string str in collEnum) { Console.WriteLine("Element {0}", str); } } }