ConnectionManager.Description 属性

定义

获取或设置 ConnectionManager 对象的说明。

public:
 property System::String ^ Description { System::String ^ get(); void set(System::String ^ value); };
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "DescriptionDesc")]
public string Description { get; set; }
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "DescriptionDesc")>]
member this.Description : string with get, set
Public Property Description As String

属性值

一个字符串,其中包含提供给连接管理器的说明。

实现

属性

示例

下面的代码示例创建新的 FILE 连接管理器并设置多个属性,包括 Description.

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  
using Microsoft.SqlServer.Dts.Tasks.FileSystemTask;  

namespace FileSystemTask_API  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            String sourceDir = @"C:\TestFolder";  
            Package pkg = new Package();  

            // Create a File connection manager.  
            ConnectionManager cm = 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);  
        }  
    }  
}  
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)  
        End Sub  
    End Class  
End Namespace  

适用于