Advertisement
Guest User

Untitled

a guest
Jul 12th, 2013
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class DAO
  2. {
  3.     static void Main()
  4.     {
  5.         int year = 1997;
  6.         FindAllCustomers(year, "Canada");
  7.     }
  8.  
  9.     static void FindAllCustomers(int orderDate, string shipDestination)
  10.     {
  11.         using (NORTHWNDEntities db = new NORTHWNDEntities())
  12.         {
  13.             var orders = from order in db.Orders
  14.                          where order.OrderDate.Value.Year == orderDate && order.ShipCountry == shipDestination
  15.                          select order;
  16.  
  17.             foreach (var item in orders)
  18.             {
  19.                 Console.WriteLine("Order made by: {0} with CustomerId: {1}", item.Customer.ContactName, item.Customer.CustomerID);
  20.             }
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement