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]; //} }
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); } }
/// <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(); }
protected IngresConnection OpenConnection(IngresConnectionStringBuilder csb) { return(OpenConnection(csb.ToString())); }
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 })); }