Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Pipeline
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Module Module1
Sub Main()
Dim package As Microsoft.SqlServer.Dts.Runtime.Package = _
New Microsoft.SqlServer.Dts.Runtime.Package()
Dim e As Executable = package.Executables.Add("STOCK:PipelineTask")
Dim thMainPipe As Microsoft.SqlServer.Dts.Runtime.TaskHost = _
CType(e, Microsoft.SqlServer.Dts.Runtime.TaskHost)
Dim dataFlowTask As MainPipe = CType(thMainPipe.InnerObject, MainPipe)
' Create the source component.
Dim source As IDTSComponentMetaData100 = _
dataFlowTask.ComponentMetaDataCollection.New()
source.ComponentClassID = "DTSAdapter.OleDbSource"
Dim srcDesignTime As CManagedComponentWrapper = source.Instantiate()
srcDesignTime.ProvideComponentProperties()
' Create the destination component.
Dim destination As IDTSComponentMetaData100 = _
dataFlowTask.ComponentMetaDataCollection.New()
destination.ComponentClassID = "DTSAdapter.OleDbDestination"
Dim destDesignTime As CManagedComponentWrapper = destination.Instantiate()
destDesignTime.ProvideComponentProperties()
' Create the path.
Dim path As IDTSPath100 = dataFlowTask.PathCollection.New()
path.AttachPathAndPropagateNotifications(source.OutputCollection(0), _
destination.InputCollection(0))
End Sub
End Module