Ejemplo n.º 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;
                }
            }
        }
Ejemplo n.º 2
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;
                }
            }
        }
        public PowerBIConnectionManagerUIForm(Microsoft.SqlServer.Dts.Runtime.ConnectionManager connectionManager, IServiceProvider serviceProvider)
            : this()
        {
            this.connectionManager = connectionManager;
            this.serviceProvider   = serviceProvider;

            SetFormValuesFromConnectionManager();
        }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 5
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);
     }
 }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 8
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;
        }
Ejemplo n.º 9
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;
            }
        }
Ejemplo n.º 10
0
 public void Initialize(Microsoft.SqlServer.Dts.Runtime.ConnectionManager connectionManager, IServiceProvider serviceProvider)
 {
     this.connectionManager = connectionManager;
     this.serviceProvider   = serviceProvider;
 }