public static SQLBrokerConfig GetBrokerConfig() { var conf = (System.Collections.Hashtable)System.Configuration.ConfigurationManager.GetSection("SQLBrokerConfig"); if (conf != null) { var c = new SQLBrokerConfig { connectionConfigFromCaller = bool.Parse(conf["connectionConfigFromCaller"]?.ToString()), readOnly = bool.Parse(conf["readOnly"]?.ToString()), readTransactionsOnSQLGet = bool.Parse(conf["readTransactionsOnSQLGet"]?.ToString()), sql = bool.Parse(conf["sql"]?.ToString()), bo = bool.Parse(conf["bo"]?.ToString()), uq = bool.Parse(conf["uq"]?.ToString()), defaultProfile = conf["defaultProfile"]?.ToString(), exposedUQCategories = conf["exposedUQCategories"]?.ToString(), maxConnections = int.Parse(conf["maxConnections"]?.ToString()), }; if (!string.IsNullOrEmpty(c.defaultProfile)) { c.defaultConnection = ConnectionParams.GetConnectionProfile(c.defaultProfile); } return(c); } else { return(new SQLBrokerConfig()); } }
public SQLBrokerError(string message, Exception innerException = null, ConnectionParams connection = null, SQLResult sqlResult = null, BOResult boResult = null) : base(message, innerException) { config = SAPB1.brokerConf; this.boResult = boResult; this.sqlResult = sqlResult; this.connection = new NoPwdConnectionParams(connection); if (this.connection == null && boResult?.connection != null) { this.connection = boResult?.connection; } if (this.connection == null && sqlResult?.connection != null) { this.connection = sqlResult?.connection; } }