コード例 #1
0
        internal InDbSqlDatabase(Hashtable parameters)
            : base(new DateTime(1754, 1, 1), new DateTime(9999, 1, 1))
        {
            this.FConnectionString = InDbManager.BuildConnectionString(parameters, InDbManager.SqlParams);
            object parameter = parameters[(object)"command-timeout"];

            this.FCommandTimeout = parameter != null?Convert.ToInt32(parameter) : 0;
        }
コード例 #2
0
        public static InDbDatabase OpenDatabase(string driverName, Hashtable parameters)
        {
            if (string.Compare(driverName, "ADO.MSSQL", true) == 0)
            {
                return((InDbDatabase) new InDbSqlDatabase(parameters));
            }
            if (string.Compare(driverName, "ADO.ORACLE", true) != 0)
            {
                throw new InDbException(string.Format("Неизвестный тип драйвера InDb: {0}", (object)driverName));
            }
            OracleConnection connection = new OracleConnection(InDbManager.BuildConnectionString(parameters, InDbManager.FOracleParams));

            connection.Open();
            return((InDbDatabase) new InDbOracleDatabase(connection));
        }