_ _ _ Public Class ScriptMain Inherits UserComponent ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Overrides Sub CreateNewOutputRows() ' Retrieve Salesforce object metadata. Dim dgr As DescribeGlobalResult = Nothing Dim connection As ISforceConnection = CType( _ Me.Connections.Connection.AcquireConnection(Nothing), _ ISforceConnection) Try Dim service As SforceService = CType(connection.Connect(), SforceService) dgr = service.describeGlobal() Catch ex As Exception Call FireError_(ex.Message) Finally Call connection.Close() End Try If dgr Is Nothing Then Exit Sub End If For Each sobject As DescribeGlobalSObjectResult In dgr.sobjects With MyBase.OutputBuffer Call .AddRow() .activateable = sobject.activateable .createable = sobject.createable .custom = sobject.custom .customSetting = sobject.customSetting .deletable = sobject.deletable .deprecatedAndHidden = sobject.deprecatedAndHidden .feedEnabled = sobject.feedEnabled .keyPrefix = sobject.keyPrefix .label = sobject.label .labelPlural = sobject.labelPlural .layoutable = sobject.layoutable .mergeable = sobject.mergeable .name = sobject.name .queryable = sobject.queryable .replicateable = sobject.replicateable .retrieveable = sobject.retrieveable .searchable = sobject.searchable .triggerable = sobject.triggerable .undeletable = sobject.undeletable .updateable = sobject.updateable End With Next End Sub ' CreateNewOutputRows ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Function Validate(ByRef errMessage As String) As Boolean Dim result As Boolean Try If String.IsNullOrEmpty(Me.Connection) Then Throw New Exception("Select Salesforce Connection.") End If ' Store connection information in the runtime connection collection, too. ' Cannot directly use RuntimeConnectionCollection in the property get/set ' because of issues with multi-threading. Me.ComponentMetaData.RuntimeConnectionCollection("Connection").ConnectionManagerID = Me.Connection result = True Catch ex As Exception result = False errMessage = ex.Message End Try Validate = result End Function 'Validate #Region "Properties" ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' _ _ Public Property Connection() As String Get Connection = m_connection End Get Set(ByVal value As String) m_connection = value End Set End Property ' Connection #End Region ' Properties #Region "Internals" ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Private ReadOnly Property SforceConnectionType() As String() Get SforceConnectionType = New String() {"SFORCE"} End Get End Property ' SforceConnectionType ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Private Sub FireError_(ByVal message As String) Dim cancel As Boolean = False Call MyBase.ComponentMetaData.FireError( _ 0, _ "Salesforce Object Source", _ message, _ String.Empty, _ 0, _ cancel) End Sub ' FireError_ #End Region ' Internals #Region "Attributes" Private m_connection As String #End Region ' Attributes End Class ' ScriptMain ]]> _ Public Class OutputBuffer Inherits ScriptBufferPlus Public Sub New(ByVal Component As ScriptComponent, ByVal ObjectID As Integer, ByVal IsInput As Boolean, ByVal Buffer As PipelineBuffer, ByVal OutputMap As OutputNameMap) MyBase.New(Component, ObjectID, IsInput, Buffer, OutputMap) End Sub Public Overrides ReadOnly Property StaticInputColumns() As String() Get Return New String() {} End Get End Property Public WriteOnly Property [activateable]() As Boolean Set Me(0) = Value End Set End Property Public WriteOnly Property [activateable_IsNull] As Boolean Set If (value) SetNull(0) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [createable]() As Boolean Set Me(1) = Value End Set End Property Public WriteOnly Property [createable_IsNull] As Boolean Set If (value) SetNull(1) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [custom]() As Boolean Set Me(2) = Value End Set End Property Public WriteOnly Property [custom_IsNull] As Boolean Set If (value) SetNull(2) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [customSetting]() As Boolean Set Me(3) = Value End Set End Property Public WriteOnly Property [customSetting_IsNull] As Boolean Set If (value) SetNull(3) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [deletable]() As Boolean Set Me(4) = Value End Set End Property Public WriteOnly Property [deletable_IsNull] As Boolean Set If (value) SetNull(4) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [deprecatedAndHidden]() As Boolean Set Me(5) = Value End Set End Property Public WriteOnly Property [deprecatedAndHidden_IsNull] As Boolean Set If (value) SetNull(5) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [feedEnabled]() As Boolean Set Me(6) = Value End Set End Property Public WriteOnly Property [feedEnabled_IsNull] As Boolean Set If (value) SetNull(6) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [keyPrefix]() As String Set Me(7) = Value End Set End Property Public WriteOnly Property [keyPrefix_IsNull] As Boolean Set If (value) SetNull(7) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [label]() As String Set Me(8) = Value End Set End Property Public WriteOnly Property [label_IsNull] As Boolean Set If (value) SetNull(8) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [labelPlural]() As String Set Me(9) = Value End Set End Property Public WriteOnly Property [labelPlural_IsNull] As Boolean Set If (value) SetNull(9) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [layoutable]() As Boolean Set Me(10) = Value End Set End Property Public WriteOnly Property [layoutable_IsNull] As Boolean Set If (value) SetNull(10) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [mergeable]() As Boolean Set Me(11) = Value End Set End Property Public WriteOnly Property [mergeable_IsNull] As Boolean Set If (value) SetNull(11) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [name]() As String Set Me(12) = Value End Set End Property Public WriteOnly Property [name_IsNull] As Boolean Set If (value) SetNull(12) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [queryable]() As Boolean Set Me(13) = Value End Set End Property Public WriteOnly Property [queryable_IsNull] As Boolean Set If (value) SetNull(13) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [replicateable]() As Boolean Set Me(14) = Value End Set End Property Public WriteOnly Property [replicateable_IsNull] As Boolean Set If (value) SetNull(14) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [retrieveable]() As Boolean Set Me(15) = Value End Set End Property Public WriteOnly Property [retrieveable_IsNull] As Boolean Set If (value) SetNull(15) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [searchable]() As Boolean Set Me(16) = Value End Set End Property Public WriteOnly Property [searchable_IsNull] As Boolean Set If (value) SetNull(16) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [triggerable]() As Boolean Set Me(17) = Value End Set End Property Public WriteOnly Property [triggerable_IsNull] As Boolean Set If (value) SetNull(17) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [undeletable]() As Boolean Set Me(18) = Value End Set End Property Public WriteOnly Property [undeletable_IsNull] As Boolean Set If (value) SetNull(18) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public WriteOnly Property [updateable]() As Boolean Set Me(19) = Value End Set End Property Public WriteOnly Property [updateable_IsNull] As Boolean Set If (value) SetNull(19) Else Throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.") End If End Set End Property Public Overrides ReadOnly Property StaticOutputColumns() As String() Get Return New String() {"activateable", "createable", "custom", "customSetting", "deletable", "deprecatedAndHidden", "feedEnabled", "keyPrefix", "label", "labelPlural", "layoutable", "mergeable", "name", "queryable", "replicateable", "retrieveable", "searchable", "triggerable", "undeletable", "updateable"} End Get End Property Public Overloads Sub AddRow() MyBase.AddRow() End Sub Public Overloads Sub SetEndOfRowset() MyBase.SetEndOfRowset() End Sub Public Overloads Function EndOfRowset() As Boolean EndOfRowset = MyBase.EndOfRowset End Function End Class ]]> {30D016F9-3734-4E33-A861-5E7D899E18F3};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} Debug AnyCPU 8.0.30703 2.0 {040DBB5B-347F-4700-B83A-F048F9F826FA} Library My Project ScriptComponent_148a2fceaa5c49bebd1289f2581713d9 ScriptComponent_148a2fceaa5c49bebd1289f2581713d9 v4.0 512 true full false .\bin\Debug\ false true true prompt 4 false true .\bin\Release\ false false true prompt 4 False C:\Program Files (x86)\Microsoft SQL Server\130\SDK\Assemblies\CozyRoc.SSISPlus.2016.dll SSIS_SC130 Binary On On ]]> _ Public Class UserComponent Inherits ScriptComponentPlus Public Connections As New Connections(Me) Public Variables As New Variables(Me) Public OutputBuffer As OutputBuffer Public Overridable Sub FinishOutputs() End Sub Private Sub MarkOutputsFinished() If OutputBuffer IsNot Nothing Then OutputBuffer.SetEndOfRowset OutputBuffer = Nothing End If End Sub Public Overrides Sub PrimeOutput(ByVal Outputs As Integer, ByVal OutputIDs() As Integer, ByVal Buffers() As PipelineBuffer, ByVal OutputMap As OutputNameMap) For I As Integer = 0 To Outputs - 1 If OutputIDs(I) = GetOutputID(OutputMap, "Output") Then OutputBuffer = New OutputBuffer(Me, OutputIDs(I), False, Buffers(I), OutputMap) End If Next CreateNewOutputRows() FinishOutputs() MarkOutputsFinished() End Sub Public Overridable Sub CreateNewOutputRows() End Sub End Class Public Class Connections Dim ParentComponent As ScriptComponent _ Public Sub New(ByVal Component As ScriptComponent) ParentComponent = Component End Sub Public ReadOnly Property Connection() As IDTSConnectionManager100 Get Return ParentComponent.ComponentMetaData.RuntimeConnectionCollection("Connection").ConnectionManager End Get End Property End Class Public Class Variables Dim ParentComponent As ScriptComponent _ Public Sub New(ByVal Component As ScriptComponent) ParentComponent = Component End Sub End Class ]]> Reference;Import;Folder {8523A550-1B92-455E-A7CD-A36738A5CC85} ScriptComponent_1b6f643ad4ad4e3d90aae4fe4380e712 msBuild ScriptComponent_1b6f643ad4ad4e3d90aae4fe4380e712 ]]>CozyRoc.ScriptComponentHostPlusScriptComponent_1b6f643ad4ad4e3d90aae4fe4380e712VisualBasic