示例#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();
        }
        public EFIngresConnectionStringBuilder(string connectionString)
        {
            var builder = new DbConnectionStringBuilder();

            _wrappedConnectionStringBuilder = new IngresConnectionStringBuilder();
            builder.ConnectionString        = connectionString;
            foreach (var alias in builder.Keys.Cast <string>())
            {
                string key;
                if (_aliases.TryGetValue(alias, out key))
                {
                    _items[key] = builder[alias];
                }
                else
                {
                    _wrappedConnectionStringBuilder[alias] = builder[alias];
                }
            }

            ConnectionString = connectionString;
            //foreach (string key in Keys)
            //{
            //    this[key] = this[key];
            //}
        }
示例#3
0
文件: Program.cs 项目: nlhepler/mono
        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();
        }
        private static void UsingMasterConnection(EFIngresConnection connection, Action <EFIngresConnection> act)
        {
            var connectionBuilder = new IngresConnectionStringBuilder(connection.ConnectionString)
            {
                Database = "iidbdb"
            };

            using (var masterConnection = new EFIngresConnection(connectionBuilder.ConnectionString))
            {
                UsingConnection(masterConnection, act);
            }
        }
示例#5
0
        /// <summary>
        /// Initializes a new instance of the MainForm class.
        /// </summary>
        public MainForm()
        {
            // Initialise the form.
            this.InitializeComponent();

            // Create a new ingres connection string builder.
            this.builder = new IngresConnectionStringBuilder();

            // Default the database name to the default Ingres ASP.NET providers database
            this.builder.Database = "aspnetdb";

            // Set the property grids selected item to be the string builder.
            this.connectionStringPropertyGrid.SelectedObject = this.builder;

            // Trigger the property changed event so that the connection string text box
            // is updated for us.
            this.ConnectionStringPropertyGridValueChanged(this, null);

            // Determine the state of the ingres service and then start the timer to automatically
            // check the state periodically.
            this.DetermineIngresServiceState();

            this.timer.Start();
        }
示例#6
0
        /// <summary>
        /// Initializes a new instance of the MainForm class.
        /// </summary>
        public MainForm()
        {
            // Initialise the form.
            this.InitializeComponent();

            // Create a new ingres connection string builder.
            this.builder = new IngresConnectionStringBuilder();

            // Default the database name to the default Ingres ASP.NET providers database
            this.builder.Database = "aspnetdb";

            // Set the property grids selected item to be the string builder.
            this.connectionStringPropertyGrid.SelectedObject = this.builder;

            // Trigger the property changed event so that the connection string text box
            // is updated for us.
            this.ConnectionStringPropertyGridValueChanged(this, null);

            // Determine the state of the ingres service and then start the timer to automatically
            // check the state periodically.
            this.DetermineIngresServiceState();

            this.timer.Start();
        }
示例#7
0
 protected IngresConnection OpenConnection(IngresConnectionStringBuilder csb)
 {
     return(OpenConnection(csb.ToString()));
 }
示例#8
0
 internal static int TryGetOrdinal(this IngresConnectionStringBuilder ingresConnectionStringBuilder, string keyword)
 {
     IngresConnectionStringBuilderTryGetOrdinalMethod = IngresConnectionStringBuilderTryGetOrdinalMethod ?? typeof(IngresConnectionStringBuilder).GetWrappedMethod("TryGetOrdinal", typeof(string));
     return((int)IngresConnectionStringBuilderTryGetOrdinalMethod.Invoke(ingresConnectionStringBuilder, new object[] { keyword }));
 }