Example #1
0
        static void Main(string[] args)
        {
            IngresConnectionStringBuilder icsb = new IngresConnectionStringBuilder();

            icsb.Server   = "(server)";
            icsb.Port     = "II7";
            icsb.UserID   = "LinqUser";
            icsb.Password = "******";
            icsb.Database = "northwind";
            nwind.Northwind db = new nwind.Northwind(new IngresConnection(icsb.ConnectionString));

            var result = from customer in db.Customers
                         where customer.City == "London"
                         orderby customer.City
                         select customer;

            foreach (var r in result)
            {
                r.Fax = "changed " + DateTime.Now.Ticks.ToString();
                System.Console.WriteLine(r);
            }

            db.SubmitChanges();

            System.Console.ReadKey();
        }
Example #2
0
        static void Main(string[] args)
        {
            IngresConnectionStringBuilder icsb = new IngresConnectionStringBuilder();
            icsb.Server = "(server)";
            icsb.Port = "II7";
            icsb.UserID = "LinqUser";
            icsb.Password = "******";
            icsb.Database = "northwind";
            nwind.Northwind db = new nwind.Northwind(new IngresConnection(icsb.ConnectionString));

            var result = from customer in db.Customers
                         where customer.City == "London"
                         orderby customer.City
                         select customer;

            foreach (var r in result)
            {
                r.Fax = "changed " + DateTime.Now.Ticks.ToString();
                System.Console.WriteLine(r);
            }

            db.SubmitChanges();

            System.Console.ReadKey();
        }
Example #3
0
        static void Listing13_1()
        {
            Console.WriteLine("{0} : Begin", new StackTrace(0, true).GetFrame(0).GetMethod().Name);

            nwind.Northwind db =
                new nwind.Northwind(@"Data Source=.\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=SSPI;");

            db.Log = Console.Out;

            var custs = from c in db.Customers
                        where c.Region == "WA"
                        select new { Id = c.CustomerID, Name = c.ContactName };

            foreach (var cust in custs)
            {
                Console.WriteLine("{0} - {1}", cust.Id, cust.Name);
            }

            Console.WriteLine("{0} : End", new StackTrace(0, true).GetFrame(0).GetMethod().Name);
        }