Http://u.115.com/file/f21042d848 demo
SelectClause to generate query results and specify the "shape" or type of each returned element. For example, you can specify whether the result contains the entire customer object, only one member, a subset of the members, or a completely different result type created based on the calculation or new object. When the select clause generates content other than the Source Element copy, this operation is called "projection ". Using Projection to convert data is a powerful function of the LINQ query expression.
Northwinddatacontext DB = new northwinddatacontext (); var allcustomers = from customer in dB. customers select new {customer. contactname, customer. country}; foreach (VAR customer in allcustomers) {console. writeline ("---------------------"); console. writeline ("customer name: {0}", customer. contactname); console. writeline ("Country: {0}", customer. country );}