Cannot see Executables property on 2008R2 package?
I tried the examplle in the MSDN documentation
Shared Sub Main(ByVal args() As String)
Dim pkg As Package = New Package()
Dim exec As Executable = pkg.Executables.Add("STOCK:BulkInsertTask")
' Obtain the collection.
Dim pgkExecs As Executables = pkg.Executables
Dim eachExec As Executable
For Each eachExec In pgkExecs
Dim th As TaskHost = exec as TaskHost
Console.WriteLine("Executable creation name is: {0}", th.CreationName)
Next
' Show that at least one executable exists.
If pgkExecs.Contains(0) Then
Console.WriteLine("Contains returned true")
Else
Console.WriteLine("Contains returned false")
End If
End Sub
But VS2008 complains that
Executable is not defined.
and that there is no Executables property on Package.
I MUST be doing something wrong!
Beginners error?
Please advise
January 13th, 2011 11:35am
Imports Microsoft.SqlServer.Dts.Runtime
Module Module1
Sub Main(ByVal args() As String)
Dim pkg As Package = New Package()
Dim exec As Executable = pkg.Executables.Add("STOCK:BulkInsertTask")
' Obtain the collection.
Dim pgkExecs As Executables = pkg.Executables
Dim eachExec As Executable
For Each eachExec In pgkExecs
Dim th As TaskHost = CType(exec, TaskHost)
Console.WriteLine("Executable creation name is: {0}", th.CreationName)
Next
' Show that at least one executable exists.
If pgkExecs.Contains(0) Then
Console.WriteLine("Contains returned true")
Else
Console.WriteLine("Contains returned false")
End If
End Sub
End Module
I added reference to
C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll. Then I added the imports statement at the top. I cleaned up a few
things in the code, some to remove C# code items ("exec as TaskHost") and to work in the Console app that I used.
Russel Loski, MCT
Free Windows Admin Tool Kit Click here and download it now
January 13th, 2011 12:03pm
Russ,
VERY kind thanks!
Most cordially,
Mac
January 13th, 2011 12:23pm