Ejemplo n.º 1
0
        static void HardCoded()
        {
            Console.WriteLine("=== Hard-coded ============");
            var db = new AW();
            var q  = from b in db.SalesOrderHeaders
                     orderby b.OrderDate
                     where b.RegionCode.Equals("KS")
                     select b;

            foreach (var i in q)
            {
                Console.WriteLine("{0} - {1} - {2}",
                                  i.SalesOrderNumber,
                                  i.OrderDate.ToShortDateString(),
                                  i.RegionCode);
            }
        }
Ejemplo n.º 2
0
        static void PrintRegion(string state, int count)
        {
            Console.WriteLine("=== {0} ============", state);
            var db = new AW();
            var q  = (from b in db.SalesOrderHeaders
                      orderby b.OrderDate
                      where b.RegionCode.Equals(state)
                      select b).Take(count);

            foreach (var i in q)
            {
                Console.WriteLine("{0} - {1} - {2}",
                                  i.SalesOrderNumber,
                                  i.OrderDate.ToShortDateString(),
                                  i.RegionCode);
            }

            Console.WriteLine("");
        }