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); }
/// <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"); }
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); }
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); }
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); }
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; }
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; }
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; }