public void CreateDatabase(DatabaseParameterBuffer dpb, string dataSource, int port, string database)
        {
            lock (this)
            {
                byte[] databaseBuffer = Encoding.Default.GetBytes(database);
                int    dbHandle       = Handle;

                // Clear status vector
                ClearStatusVector();

                _fbClient.isc_create_database(
                    _statusVector,
                    (short)databaseBuffer.Length,
                    databaseBuffer,
                    ref dbHandle,
                    (short)dpb.Length,
                    dpb.ToArray(),
                    0);

                ParseStatusVector(_statusVector);

                _handle = dbHandle;

                Detach();
            }
        }
Пример #2
0
    public override void CreateDatabase(DatabaseParameterBufferBase dpb, string database, byte[] cryptKey)
    {
        CheckCryptKeyForSupport(cryptKey);

        var databaseBuffer = Encoding2.Default.GetBytes(database);

        ClearStatusVector();

        _fbClient.isc_create_database(
            _statusVector,
            (short)databaseBuffer.Length,
            databaseBuffer,
            ref _handle,
            dpb.Length,
            dpb.ToArray(),
            0);

        ProcessStatusVector(_statusVector);
    }
Пример #3
0
        public void CreateDatabase(DatabaseParameterBuffer dpb, string dataSource, int port, string database)
        {
            byte[] databaseBuffer = Encoding.UTF8.GetBytes(database);

            ClearStatusVector();

            _fbClient.isc_create_database(
                _statusVector,
                (short)databaseBuffer.Length,
                databaseBuffer,
                ref _handle,
                dpb.Length,
                dpb.ToArray(),
                0);

            ProcessStatusVector(_statusVector);

            Detach();
        }
        public override Task CreateDatabase(DatabaseParameterBufferBase dpb, string dataSource, int port, string database, byte[] cryptKey, AsyncWrappingCommonArgs async)
        {
            CheckCryptKeyForSupport(cryptKey);

            var databaseBuffer = Encoding.Default.GetBytes(database);

            ClearStatusVector();

            _fbClient.isc_create_database(
                _statusVector,
                (short)databaseBuffer.Length,
                databaseBuffer,
                ref _handle,
                dpb.Length,
                dpb.ToArray(),
                0);

            ProcessStatusVector(_statusVector);

            return(Task.CompletedTask);
        }