Http://u.115.com/file/f29a440f67 demo
There is no explicitly modeled sequence Association in the data source created by the join operation. For example, you can perform connections to find all customers that meet the following criteria: in Paris, and order products from a supplier located in London. In LINQ, the join clause always runs on an object set instead of a database table. In LINQ, you do not need to use join as frequently as in SQL, because the foreign key in LINQ is represented as an attribute that contains the item set in the object model. For example, a customer object contains a set of order objects. You do not need to perform the join operation. You only need to use the dot notation to access the order:
Northwinddatacontext DB = new northwinddatacontext (); var allcustomers = from customer in dB. customers select customer; foreach (VAR customer in allcustomers) {console. writeline ("---------------------"); console. writeline ("Customer ID: {0}", customer. customerid); console. writeline ("customer name: {0}", customer. contactname); foreach (VAR order in customer. orders) {console. writeline ("Order ID: {0}", order. orderid );}}