예제 #1
0
        public override IDTSComponentMetaData100 AddDestAdapter(IDTSPipeline100 pipeline, ConnectionManager destConnMgr, out IDTSDesigntimeComponent100 destDesignTimeComp)
        {
            if (String.IsNullOrEmpty(quotedTableName))
            {
                throw new ArgumentException("Destination table name is empty");
            }
            IDTSComponentMetaData100 destComp = pipeline.ComponentMetaDataCollection.New();

            destComp.ComponentClassID         = OLEDB_DEST_GUID;
            destComp.ValidateExternalMetadata = true;
            destDesignTimeComp = destComp.Instantiate();
            destDesignTimeComp.ProvideComponentProperties();
            destComp.Name = "OleDB Destination - Sql Server";
            destDesignTimeComp.SetComponentProperty("AccessMode", 0);
            destDesignTimeComp.SetComponentProperty("OpenRowset", quotedTableName);

            // set connection
            destComp.RuntimeConnectionCollection[0].ConnectionManager   = DtsConvert.GetExtendedInterface(destConnMgr);
            destComp.RuntimeConnectionCollection[0].ConnectionManagerID = destConnMgr.ID;

            // get metadata
            destDesignTimeComp.AcquireConnections(null);
            destDesignTimeComp.ReinitializeMetaData();
            destDesignTimeComp.ReleaseConnections();

            extCols = destComp.InputCollection[0].ExternalMetadataColumnCollection;

            return(destComp);
        }
예제 #2
0
        /// <summary>
        /// Refresh meta data for a given component instance
        /// </summary>
        /// <param name="componentInstance"></param>
        public static void RefreshMetaData(this IDTSDesigntimeComponent100 componentInstance)
        {
            try
            {
                if (componentInstance != null)
                {
                    componentInstance.AcquireConnections(null);
                    componentInstance.ReinitializeMetaData();
                    componentInstance.ReleaseConnections();
                    return;
                }
            }
            catch (Exception err)
            {
                throw new SsisScripterException("Exception caught when component refreshing meta data", err);
            }

            throw new SsisScripterException("The IDTSDesigntimeComponent100 object passed to this method was null");
        }
예제 #3
0
        public override IDTSComponentMetaData100 AddDestAdapter(IDTSPipeline100 pipeline, ConnectionManager destConnMgr, out IDTSDesigntimeComponent100 destDesignTimeComp)
        {
            IDTSComponentMetaData100 destComp = pipeline.ComponentMetaDataCollection.New();

            destComp.ComponentClassID         = FLATFILE_DEST_GUID;
            destComp.ValidateExternalMetadata = true;
            destDesignTimeComp = destComp.Instantiate();
            destDesignTimeComp.ProvideComponentProperties();
            destComp.Name = "Flat File Destination";
            destDesignTimeComp.SetComponentProperty("Overwrite", true);

            // set connection
            destComp.RuntimeConnectionCollection[0].ConnectionManager   = DtsConvert.GetExtendedInterface(destConnMgr);
            destComp.RuntimeConnectionCollection[0].ConnectionManagerID = destConnMgr.ID;

            // get metadata
            destDesignTimeComp.AcquireConnections(null);
            destDesignTimeComp.ReinitializeMetaData();
            destDesignTimeComp.ReleaseConnections();
            return(destComp);
        }
예제 #4
0
        public override IDTSComponentMetaData100 AddSourceAdapter(IDTSPipeline100 pipeline, ConnectionManager srcConnMgr)
        {
            IDTSComponentMetaData100 srcComp = pipeline.ComponentMetaDataCollection.New();

            srcComp.ComponentClassID         = FLATFILE_SRC_GUID;
            srcComp.ValidateExternalMetadata = true;
            IDTSDesigntimeComponent100 srcDesignTimeComp = srcComp.Instantiate();

            srcDesignTimeComp.ProvideComponentProperties();
            srcComp.Name = "Flat File Source";

            // set connection
            srcComp.RuntimeConnectionCollection[0].ConnectionManager   = DtsConvert.GetExtendedInterface(srcConnMgr);
            srcComp.RuntimeConnectionCollection[0].ConnectionManagerID = srcConnMgr.ID;

            // get metadata
            srcDesignTimeComp.AcquireConnections(null);
            srcDesignTimeComp.ReinitializeMetaData();
            srcDesignTimeComp.ReleaseConnections();
            return(srcComp);
        }
예제 #5
0
        public override IDTSComponentMetaData100 AddDestAdapter(IDTSPipeline100 pipeline, ConnectionManager destConnMgr, out IDTSDesigntimeComponent100 destDesignTimeComp)
        {
            IDTSComponentMetaData100 destComp = pipeline.ComponentMetaDataCollection.New();

            destComp.ComponentClassID         = EXCEL_DEST_GUID;
            destComp.ValidateExternalMetadata = true;
            destDesignTimeComp = destComp.Instantiate();
            destDesignTimeComp.ProvideComponentProperties();
            destComp.Name = "OleDB Destination - Excel";
            destDesignTimeComp.SetComponentProperty("AccessMode", 0);
            // OleDb provider does not recognize OpenRowSet name quoted with `
            destDesignTimeComp.SetComponentProperty("OpenRowset", UnquotedSheetName);

            // set connection
            destComp.RuntimeConnectionCollection[0].ConnectionManager   = DtsConvert.GetExtendedInterface(destConnMgr);
            destComp.RuntimeConnectionCollection[0].ConnectionManagerID = destConnMgr.ID;
            // get metadata
            destDesignTimeComp.AcquireConnections(null);
            destDesignTimeComp.ReinitializeMetaData();
            destDesignTimeComp.ReleaseConnections();
            extCols = destComp.InputCollection[0].ExternalMetadataColumnCollection;
            return(destComp);
        }
예제 #6
0
        public override IDTSComponentMetaData100 AddDestAdapter(IDTSPipeline100 pipeline, ConnectionManager destConnMgr, out IDTSDesigntimeComponent100 destDesignTimeComp)
		{
			IDTSComponentMetaData100 destComp = pipeline.ComponentMetaDataCollection.New();
			destComp.ComponentClassID = EXCEL_DEST_GUID;
			destComp.ValidateExternalMetadata = true;
			destDesignTimeComp = destComp.Instantiate();
			destDesignTimeComp.ProvideComponentProperties();
			destComp.Name = "OleDB Destination - Excel";
			destDesignTimeComp.SetComponentProperty("AccessMode", 0);
            // OleDb provider does not recognize OpenRowSet name quoted with ` 
            destDesignTimeComp.SetComponentProperty("OpenRowset", UnquotedSheetName);

			// set connection
			destComp.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.GetExtendedInterface(destConnMgr);
			destComp.RuntimeConnectionCollection[0].ConnectionManagerID = destConnMgr.ID;
			// get metadata
			destDesignTimeComp.AcquireConnections(null);
			destDesignTimeComp.ReinitializeMetaData();
			destDesignTimeComp.ReleaseConnections();
            extCols = destComp.InputCollection[0].ExternalMetadataColumnCollection;
            return destComp;
		}
예제 #7
0
        public override IDTSComponentMetaData100 AddDestAdapter(IDTSPipeline100 pipeline, ConnectionManager destConnMgr, out IDTSDesigntimeComponent100 destDesignTimeComp)
        {
            IDTSComponentMetaData100 destComp = pipeline.ComponentMetaDataCollection.New();
            destComp.ComponentClassID = FLATFILE_DEST_GUID;
            destComp.ValidateExternalMetadata = true;
            destDesignTimeComp = destComp.Instantiate();
            destDesignTimeComp.ProvideComponentProperties();
            destComp.Name = "Flat File Destination";
            destDesignTimeComp.SetComponentProperty("Overwrite", true);

            // set connection
            destComp.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.GetExtendedInterface(destConnMgr);
            destComp.RuntimeConnectionCollection[0].ConnectionManagerID = destConnMgr.ID;

            // get metadata
            destDesignTimeComp.AcquireConnections(null);
            destDesignTimeComp.ReinitializeMetaData();
            destDesignTimeComp.ReleaseConnections();
            return destComp;
        }
예제 #8
0
        public override IDTSComponentMetaData100 AddDestAdapter(IDTSPipeline100 pipeline, ConnectionManager destConnMgr, out IDTSDesigntimeComponent100 destDesignTimeComp)
        {
            if (String.IsNullOrEmpty(quotedTableName))
            {
                throw new ArgumentException("Destination table name is empty");
            }
            IDTSComponentMetaData100 destComp = pipeline.ComponentMetaDataCollection.New();
            destComp.ComponentClassID = OLEDB_DEST_GUID;
            destComp.ValidateExternalMetadata = true;
            destDesignTimeComp = destComp.Instantiate();
            destDesignTimeComp.ProvideComponentProperties();
            destComp.Name = "OleDB Destination - Sql Server";
            destDesignTimeComp.SetComponentProperty("AccessMode", 0);
            destDesignTimeComp.SetComponentProperty("OpenRowset", quotedTableName);

            // set connection
            destComp.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.GetExtendedInterface(destConnMgr);
            destComp.RuntimeConnectionCollection[0].ConnectionManagerID = destConnMgr.ID;

            // get metadata
            destDesignTimeComp.AcquireConnections(null);
            destDesignTimeComp.ReinitializeMetaData();
            destDesignTimeComp.ReleaseConnections();

            extCols = destComp.InputCollection[0].ExternalMetadataColumnCollection;

            return destComp;
        }