次の方法で共有


Name プロパティ

"SSIS log provider for Text files" などの LogProvider オブジェクトの名前を取得します。値の設定も可能です。この文字列は、[プロバイダーの種類] メニューの [SSIS ログの構成] ダイアログ ボックス ([プロバイダーとログ] タブ) に表示されるテキストです。

名前空間:  Microsoft.SqlServer.Dts.Runtime
アセンブリ:  Microsoft.SqlServer.ManagedDTS (Microsoft.SqlServer.ManagedDTS.dll)

構文

'宣言
Public Property Name As String
    Get
    Set
'使用
Dim instance As LogProvider
Dim value As String

value = instance.Name

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

プロパティ値

型: System. . :: . .String
LogProvider の名前を表す String です。

実装

IDTSName. . :: . .Name

説明

ログ プロバイダーが Add メソッドを使用して追加された場合は、既定の Name が完全修飾アセンブリ名、ProgID、または ClassID になります。ログ プロバイダーの ProgID および ClassID の一覧は、Add 内にあります。

使用例

次のコード例では、ログ記録が有効になっているパッケージを読み込みます。パッケージを読み込んだ後に、LogProviders コレクションが作成され、コレクション内の各ログ プロバイダーが列挙されて、Name などの各プロパティの値が出力されます。

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

namespace LogProvider_Properties_Test
{
    class Program
    {
        static void Main(string[] args)
        {
            // The package is one of the SSIS samples,
            // modified to log information to the "SSIS
            // log provider for Text files".
            string mySample = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx";
            // Create the Application, and load the sample.
            Application app = new Application();
            Package pkg = app.LoadPackage(mySample, null);

            // Get the LogProviders collection from the package.
            LogProviders logProvs = pkg.LogProviders;
            foreach (LogProvider logProv in logProvs)
            {
                Console.WriteLine("ConfigString:   {0}", logProv.ConfigString);
                Console.WriteLine("CreationName    {0}", logProv.CreationName);
                Console.WriteLine("DelayValidation {0}", logProv.DelayValidation);
                Console.WriteLine("Description     {0}", logProv.Description);
                Console.WriteLine("HostType        {0}", logProv.HostType);
                Console.WriteLine("ID              {0}", logProv.ID);
                Console.WriteLine("InnerObject     {0}", logProv.InnerObject);
                Console.WriteLine("Name            {0}", logProv.Name);
             }
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Tasks.DMQueryTask
 
Namespace LogProvider_Properties_Test
    Class Program
        Shared  Sub Main(ByVal args() As String)
            ' The package is one of the SSIS samples,
            ' modified to log information to the "SSIS
            ' log provider for Text files".
            Dim mySample As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx" 
            ' Create the Application, and load the sample.
            Dim app As Application =  New Application() 
            Dim pkg As Package =  app.LoadPackage(mySample,Nothing) 
 
            ' Get the LogProviders collection from the package.
            Dim logProvs As LogProviders =  pkg.LogProviders 
            Dim logProv As LogProvider
            For Each logProv In logProvs
                Console.WriteLine("ConfigString:   {0}", logProv.ConfigString)
                Console.WriteLine("CreationName    {0}", logProv.CreationName)
                Console.WriteLine("DelayValidation {0}", logProv.DelayValidation)
                Console.WriteLine("Description     {0}", logProv.Description)
                Console.WriteLine("HostType        {0}", logProv.HostType)
                Console.WriteLine("ID              {0}", logProv.ID)
                Console.WriteLine("InnerObject     {0}", logProv.InnerObject)
                Console.WriteLine("Name            {0}", logProv.Name)
            Next
        End Sub
    End Class
End Namespace

サンプルの出力 :

ConfigString:

CreationName DTS.LogProviderTextFile.2

DelayValidation False

Description Writes log entries for events to a CSV file

HostType LogProvider

ID {1E107E39-DB79-4F02-B8A7-61D88F2DEF63}

InnerObject System.__ComObject

Name SSIS log provider for Text files