コード例 #1
0
        private void AddConnection(ConnectionConfiguration connectionConfiguration)
        {
            if (SsisPackage.CurrentPackage.DTSPackage.Connections.Contains(connectionConfiguration.Name))
            {
                MessageEngine.Global.Trace(Severity.Alert, Resources.ConnectionNameConflicts, connectionConfiguration.Name);
                _connectionManager = SsisPackage.CurrentPackage.DTSPackage.Connections[connectionConfiguration.Name];
            }
            else
            {
                _connectionManager      = SsisPackage.CurrentPackage.DTSPackage.Connections.Add(connectionConfiguration.Type);
                _connectionManager.Name = connectionConfiguration.Name;

                switch (connectionConfiguration.Type)
                {
                case "OLEDB":
                    string connectionString = connectionConfiguration.ConnectionString;
                    SetProperty("RetainSameConnection", connectionConfiguration.RetainSameConnection);
                    SetProperty("ConnectionString", connectionString);
                    break;

                case "FILE":
                    SetExpression("ConnectionString", connectionConfiguration.ConnectionString);
                    break;

                default:
                    MessageEngine.Global.Trace(Severity.Error, Resources.ConnectionTypeNotImplemented, connectionConfiguration.Type);
                    break;
                }
            }
        }
コード例 #2
0
ファイル: SsisConnection.cs プロジェクト: japj/vulcan
        private void AddConnection(ConnectionConfiguration connectionConfiguration)
        {
            if (SsisPackage.CurrentPackage.DTSPackage.Connections.Contains(connectionConfiguration.Name))
            {
                MessageEngine.Global.Trace(Severity.Alert, Resources.ConnectionNameConflicts, connectionConfiguration.Name);
                _connectionManager = SsisPackage.CurrentPackage.DTSPackage.Connections[connectionConfiguration.Name];
            }
            else
            {
                _connectionManager = SsisPackage.CurrentPackage.DTSPackage.Connections.Add(connectionConfiguration.Type);
                _connectionManager.Name = connectionConfiguration.Name;

                switch (connectionConfiguration.Type)
                {
                    case "OLEDB":
                        string connectionString = connectionConfiguration.ConnectionString;
                        SetProperty("RetainSameConnection", connectionConfiguration.RetainSameConnection);
                        SetProperty("ConnectionString", connectionString);
                        break;
                    case "FILE":
                        SetExpression("ConnectionString", connectionConfiguration.ConnectionString);
                        break;
                    default:
                        MessageEngine.Global.Trace(Severity.Error, Resources.ConnectionTypeNotImplemented, connectionConfiguration.Type);
                        break;
                }
            }
        }
コード例 #3
0
        public PowerBIConnectionManagerUIForm(Microsoft.SqlServer.Dts.Runtime.ConnectionManager connectionManager, IServiceProvider serviceProvider)
            : this()
        {
            this.connectionManager = connectionManager;
            this.serviceProvider   = serviceProvider;

            SetFormValuesFromConnectionManager();
        }
コード例 #4
0
 // Get an existing connection
 public SsisConnection(string connectionName)
 {
     if (SsisPackage.CurrentPackage.DTSPackage.Connections.Contains(connectionName))
     {
         _connectionManager = SsisPackage.CurrentPackage.DTSPackage.Connections[connectionName];
     }
     else
     {
         MessageEngine.Global.Trace(Severity.Alert, Resources.ConnectionNotExists, connectionName);
     }
 }
コード例 #5
0
ファイル: SsisConnection.cs プロジェクト: japj/vulcan
 // Get an existing connection
 public SsisConnection(string connectionName)
 {
     if (SsisPackage.CurrentPackage.DTSPackage.Connections.Contains(connectionName))
     {
         _connectionManager = SsisPackage.CurrentPackage.DTSPackage.Connections[connectionName];
     }
     else
     {
         MessageEngine.Global.Trace(Severity.Alert, Resources.ConnectionNotExists, connectionName);
     }
 }
コード例 #6
0
        public Connection(Packages.VulcanPackage vulcanPackage, string name, string description, string connectionType, string connectionString)
            :
            base(
                vulcanPackage,
                name,
                description,
                vulcanPackage.DTSPackage
                )
        {
            if (vulcanPackage.DTSPackage.Connections.Contains(name))
            {
                this._connectionManager = vulcanPackage.DTSPackage.Connections[name];
                return;
            }
            else
            {
                switch (connectionType.ToUpperInvariant())
                {
                case "FILE":
                    _connectionManager = vulcanPackage.DTSPackage.Connections.Add("FILE");
                    SetExpression("ConnectionString", connectionString);
                    break;

                case "FTP":
                    _connectionManager = vulcanPackage.DTSPackage.Connections.Add("FTP");
                    SetExpression("ConnectionString", connectionString);
                    break;

                case "OLEDB":
                    _connectionManager = vulcanPackage.DTSPackage.Connections.Add("OLEDB");
                    SetProperty("ConnectionString", connectionString);
                    SetProperty("RetainSameConnection", "True");
                    SetExpression("RetainSameConnection", @"true");

                    break;

                default:
                    Message.Trace(Severity.Error, "Only FILE and OLEDB connection types are implemented.");
                    break;
                }
                _connectionManager.Name        = name;
                _connectionManager.Description = description;
            }
        }
コード例 #7
0
        public override void Initialize(SsisEmitterContext context)
        {
            if (!IsInitialized)
            {
                if (context.Package.DtsPackage.Connections.Contains(Name))
                {
                    _connectionManager = context.Package.DtsPackage.Connections[Name];
                    ReusedExisting     = true;
                }
                else
                {
                    _connectionManager                  = context.Package.DtsPackage.Connections.Add(ConnectionType);
                    _connectionManager.Name             = Name;
                    _connectionManager.ConnectionString = ConnectionString;
                }

                // Get reinitialized connection string.
                ConnectionString = _connectionManager.ConnectionString;
            }

            IsInitialized = true;
        }
コード例 #8
0
ファイル: Connection.cs プロジェクト: japj/vulcan
        public override void Initialize(SsisEmitterContext context)
        {
            if (!IsInitialized)
            {
                if (context.Package.DtsPackage.Connections.Contains(Name))
                {
                    _connectionManager = context.Package.DtsPackage.Connections[Name];
                    ReusedExisting = true;
                }
                else
                {
                    _connectionManager = context.Package.DtsPackage.Connections.Add(ConnectionType);
                    _connectionManager.Name = Name;
                    _connectionManager.ConnectionString = ConnectionString;
                }

                // Get reinitialized connection string.
                ConnectionString = _connectionManager.ConnectionString;
            }

            IsInitialized = true;
        }
コード例 #9
0
ファイル: Connection.cs プロジェクト: japj/vulcan
        public Connection(Packages.VulcanPackage vulcanPackage, string name, string description, string connectionType, string connectionString)
            : base(vulcanPackage,
            name,
            description,
            vulcanPackage.DTSPackage)
        {
            if (vulcanPackage.DTSPackage.Connections.Contains(name))
            {
                this._connectionManager = vulcanPackage.DTSPackage.Connections[name];
                return;
            }
            else
            {
                switch (connectionType.ToUpperInvariant())
                {
                    case "FILE":
                        _connectionManager = vulcanPackage.DTSPackage.Connections.Add("FILE");
                        SetExpression("ConnectionString", connectionString);
                        break;
                    case "FTP":
                        _connectionManager = vulcanPackage.DTSPackage.Connections.Add("FTP");
                        SetExpression("ConnectionString", connectionString);
                        break;
                    case "OLEDB":
                        _connectionManager = vulcanPackage.DTSPackage.Connections.Add("OLEDB");
                        SetProperty("ConnectionString",connectionString);
                        SetProperty("RetainSameConnection","True");
                        SetExpression("RetainSameConnection",@"true");

                        break;
                    default:
                        Message.Trace(Severity.Error,"Only FILE and OLEDB connection types are implemented.");
                        break;
                }
                _connectionManager.Name = name;
                _connectionManager.Description = description;
            }
        }
コード例 #10
0
 public void Initialize(Microsoft.SqlServer.Dts.Runtime.ConnectionManager connectionManager, IServiceProvider serviceProvider)
 {
     this.connectionManager = connectionManager;
     this.serviceProvider   = serviceProvider;
 }