Ejemplo n.º 1
0
        private void Save()
        {
            try
            {
                _DTSApplication.UpdatePackage = true;
                _DTSApplication.UpdateObjects = true;

                Directory.CreateDirectory(PackageFolder);
                _DTSApplication.SaveToXml(PackagePath, DtsPackage, null);
                SsisProject.Save();
            }
            catch (Exception)
            {
                MessageEngine.Trace(AstNamedNode, Severity.Error, "V0101", "Failed to write package {0}. Files may be locked by another process.", Name);
            }
        }
        public Project(SsisProject ssisProject)
        {
            ProjectWrapper = new ProjectWrapper()
            {
                Name     = ssisProject.Name,
                LocaleId = ssisProject.LocaleId,
                StopBuildOnScriptErrors = Convert.ToBoolean(Properties.Instance.OtherProperties["StopBuildOnScriptErrors"], CultureInfo.InvariantCulture),
                Version = (SqlServerVersion)ssisProject.TargetSqlServerVersion
            };

            SetProtectionLevel(ssisProject.ProtectionLevel, ssisProject.Password);
            SetParameters(ssisProject.Parameters);
            ConnectionManagerFactory.CreateConnectionManagers(ProjectWrapper, ssisProject.Connections);
            CreateScriptProjects(ssisProject.ScriptProjects);
            CreatePackages(ssisProject.Packages);
        }
Ejemplo n.º 3
0
        public SsisPackage(Package logicalPackage, SSISEmitterContext context) : base (logicalPackage, context)
        {
            _DTSApplication = new DTS.Application();
            _DTSPackage = new DTS.Package();
            _DTSPackage.Name = Name.Replace(".", "_").Replace("[", " ").Replace("]", " ");
            _projectManager = new SsisProject(this);

            CurrentPackage = this;
        }