共用方式為


ConnectionManager.Description Property

Gets or sets the description of the ConnectionManager object.

命名空間: Microsoft.SqlServer.Dts.Runtime
組件: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

語法

'宣告
Public Property Description As String
public string Description { get; set; }
public:
virtual property String^ Description {
    String^ get () sealed;
    void set (String^ value) sealed;
}
/** @property */
public final String get_Description ()

/** @property */
public final void set_Description (String value)
public final function get Description () : String

public final function set Description (value : String)

屬性值

A String that contains the description given to the connection manager.

範例

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

執行緒安全性

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

ConnectionManager Class
ConnectionManager Members
Microsoft.SqlServer.Dts.Runtime Namespace