CreationName Property

ConnectionManager.CreationName Property

 

Returns the string that is used by the runtime to create an instance of the ConnectionManager object and to add the object to the Connections collection. This property is read-only.

Namespace:   Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

Public ReadOnly Property CreationName As String

Property Value

Type: System.String

A String that contains the connection manager name. The name may be the fully qualified assembly name (for managed assemblies), it may be the ProgID or CLSID (for COM DLLs), or it may be one of the STOCK monikers used to create the connection manager for a file.

The following code example creates a new FILE connection manager and displays the CreationName assigned to it by the runtime.

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Tasks.FileSystemTask

Namespace FileSystemTask_API
    Class Program
        Shared  Sub Main(ByVal args() As String)
            Dim sourceDir As String =  "C:\TestFolder" 
            Dim pkg As Package =  New Package() 

            ' Create a File connection manager.
            Dim cm As ConnectionManager =  pkg.Connections.Add("FILE") 
            cm.Name = "The FILE connection manager"
            cm.Description = "My FILE connection manager"
            cm.ConnectionString = sourceDir
            cm.Properties("FileUsageType").SetValue(cm, DTSFileConnectionUsageType.FolderExists)
            Console.WriteLine("CreationName:  {0}", cm.CreationName)
        End Sub
    End Class
End Namespace

Sample Output:

CreationName: FILE

Return to top
Show:
© 2016 Microsoft