这个例子在madn上,写在这里纯属练字,需要System.Data.Linq;

 1        static void doSomething()
 2        {
 3            Table<Customer> Customers = db.GetTable<Customers>();
 4            IQueryable<string> custNameQuery = from cust in Customers
 5                                               where cust.City = "Fuzhou"
 6                                               select cust.Name;
 7            foreach (string name in custNameQuery)
 8            {
 9                Console.WriteLine("the name is {0}", name);
10            }

11        }
 posted on 2008-04-03 23:16  JasonSu  阅读(144)  评论(0)    收藏  举报