Пример #1
0
        /// <summary>
        /// Returns a connection from the connection pool.
        /// </summary> 
        /// <param></param>
        /// <param name="connectionInfo"></param>
        /// <returns></returns>
        public static MapiConnection GetConnectionhandle(MonetDbConnectionInfo connectionInfo)
        {
            var connection = MapiLib.MapiConnect(connectionInfo.Host, connectionInfo.GetPort(), UserName, Password, Language, connectionInfo.Database);

            DieConnectionError(connection);

            return connection;
        }
Пример #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="clientModel"></param>
        public MonetBulkCopyModel(MonetDbConnectionInfo clientModel)
            : this()
        {
            Host = clientModel.Host;
            Database = clientModel.Database;

            SetPort(clientModel.GetPort());
        }
Пример #3
0
        public static MonetDbConnectionInfo GetDatabaseInfo(MonetDbConnectionInfo connectionInfo)
        {
            var form = new DatabaseForm(connectionInfo);

            return form.ShowDialog() != DialogResult.OK
                ? null
                : new MonetDbConnectionInfo
                {
                    Host = connectionInfo.Host,
                    Database = form.tbxDb.Text
                };
        }
Пример #4
0
        public BulkLoaderForm(MonetDbConnectionInfo monetDbConnectionInfo)
        {
            InitializeComponent();

            _connectionInfo = monetDbConnectionInfo;

            _worker = new BackgroundWorker
            {
                WorkerReportsProgress = true,
                WorkerSupportsCancellation = true
            };
            _dataConnector = DataConnectorFactoryHelper.GetDataFactory(DataSourceType.SqlServer);
        }
Пример #5
0
        /// <summary>
        /// </summary>
        /// <param name="monetCredentialsModel"></param>
        /// <param name="schemaName"></param>
        /// <param name="tableName"></param>
        /// <param name="columns"></param>
        /// <param name="rows"></param>
        /// <param name="batchSize"></param>
        public static bool BulkCopy(MonetDbConnectionInfo monetCredentialsModel, string schemaName, string tableName, TableColumnInfo[] columns, string[] rows, int batchSize)
        {
            var serviceClient = GetFactory(monetCredentialsModel.Host);
            var model = new MonetBulkCopyModel(monetCredentialsModel)
            {
                SchemaName = schemaName,
                TableName = tableName,
                Columns = columns,
                BatchSize = batchSize
            };
            var rowsBytes = rows.ToBytes();

            model.Rows = rowsBytes.Lz4Compress();

            return serviceClient.ServiceProxy.BulkCopy(model);
        }
Пример #6
0
 public DatabaseForm(MonetDbConnectionInfo connectionInfo)
     : this()
 {
     _connectionInfo = connectionInfo;
 }
Пример #7
0
        public ExploreForm(MonetDbConnectionInfo connectionInfo)
        {
            InitializeComponent();

            _connectionInfo = connectionInfo;
        }
Пример #8
0
 /// <summary>
 /// </summary>
 /// <param name="connectionString"></param>
 public MonetDatabase(string connectionString)
 {
     _connectionInfo = new MonetDbConnectionInfo(connectionString);
 }