ConnectionManager.Description 属性

Gets or sets the description of the ConnectionManager object.

命名空间:  Microsoft.SqlServer.Dts.Runtime
程序集:  Microsoft.SqlServer.ManagedDTS(在 Microsoft.SqlServer.ManagedDTS.dll 中)

语法

声明
Public Property Description As String 
    Get 
    Set
用法
Dim instance As ConnectionManager 
Dim value As String 

value = instance.Description

instance.Description = value
public string Description { get; set; }
public:
virtual property String^ Description {
    String^ get () sealed;
    void set (String^ value) sealed;
}
abstract Description : string with get, set 
override Description : string with get, set
final function get Description () : String 
final function set Description (value : String)

属性值

类型:System.String
A String that contains the description given to the connection manager.

实现

IDTSName.Description

示例

The following code example creates a new FILE connection manager and sets several properties, including the 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

请参阅

参考

ConnectionManager 类

Microsoft.SqlServer.Dts.Runtime 命名空间