public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e) { FormConnectionString dlg = new FormConnectionString(); dlg.ProviderID = "postgre"; dlg.UseProviderInConnectionString = false; if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { DbConnectionString dbConnStr = dlg.DbConnectionString; ConfigConnections connStream = new ConfigConnections("postgis", "546B0513-D71D-4490-9E27-94CD5D72C64A"); string connectionString = dbConnStr.ConnectionString; string id = ConfigTextStream.ExtractValue(connectionString, "database"); id = connStream.GetName(id); connStream.Add(id, dbConnStr.ToString()); e.NewExplorerObject = new PostGISExplorerObject(this.ParentExplorerObject, id, dbConnStr); //string connStr = dlg.ConnectionString; //ConfigTextStream stream = new ConfigTextStream("postgis_connections", true, true); //string id = ConfigTextStream.ExtractValue(connStr, "Database"); //id += "@" + ConfigTextStream.ExtractValue(connStr, "Server"); //if (id == "@") id = "PostGIS Connection"; //stream.Write(connStr, ref id); //stream.Close(); //e.NewExplorerObject = new PostGISExplorerObject(id, dlg.ConnectionString); } }
public void Save(IPersistStream stream) { stream.Save("dbconn", _dbConn.ToString()); stream.Save("table", _table); stream.Save("idfield", _idField); stream.Save("xfield", _xField); stream.Save("yfield", _yField); if (_sRef != null) { stream.Save("sref", _sRef.ToXmlString()); } }
private void getConnectionString_Click(object sender, EventArgs e) { DbConnectionString dbConnStr = new DbConnectionString(); dbConnStr.FromString(txtConnectionString.Text); FormConnectionString dlg = new FormConnectionString(dbConnStr); dlg.UseProviderInConnectionString = true; if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { dbConnStr = dlg.DbConnectionString; txtConnectionString.Text = dbConnStr.ToString(); } }
public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e) { FormConnectionString dlg = new FormConnectionString(); dlg.ProviderID = "oracle"; dlg.UseProviderInConnectionString = false; if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { DbConnectionString dbConnStr = dlg.DbConnectionString; ConfigConnections connStream = new ConfigConnections("oracle", "546B0513-D71D-4490-9E27-94CD5D72C64A"); string connectionString = dbConnStr.ConnectionString; string id = ConfigTextStream.ExtractOracleValue(connectionString, "service_name") + "@" + ConfigTextStream.ExtractOracleValue(connectionString, "host"); id = connStream.GetName(id); connStream.Add(id, dbConnStr.ToString()); e.NewExplorerObject = new OracleExplorerObject(this.ParentExplorerObject, id, dbConnStr); } }
void ConnectionProperties_Click(object sender, EventArgs e) { if (_connectionString == null) { return; } FormConnectionString dlg = new FormConnectionString(_connectionString); dlg.ProviderID = "oracle"; dlg.UseProviderInConnectionString = false; if (dlg.ShowDialog() == DialogResult.OK) { DbConnectionString dbConnStr = dlg.DbConnectionString; ConfigConnections connStream = new ConfigConnections("oracle", "546B0513-D71D-4490-9E27-94CD5D72C64A"); connStream.Add(_server, dbConnStr.ToString()); _connectionString = dbConnStr; } }