Version プロパティ

*** このメンバーは非推奨です。「解説」を参照してください。 ***    タスクのバージョンを返します。このプロパティは読み取り専用です。

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

構文

'宣言
Public Overridable ReadOnly Property Version As Integer
    Get
'使用
Dim instance As Task
Dim value As Integer

value = instance.Version
public virtual int Version { get; }
public:
virtual property int Version {
    int get ();
}
abstract Version : int
override Version : int
function get Version () : int

プロパティ値

型: System. . :: . .Int32
タスクのバージョン番号が含まれる Integer。

説明

注意

このメンバーは将来のバージョンの Microsoft SQL Server では削除される予定です。新しい開発作業では、このメンバーの使用を避け、現在このメンバーを使用しているアプリケーションは修正するようにしてください。

使用例

次のコード例では、Task から継承されるメール送信タスクを作成してから、継承されたプロパティを表示します。

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

namespace Microsoft.SqlServer.SSIS.Samples
{
    class Program
    {
        static void Main(string[] args)
        {
            Application app = new Application();
            Package pkg = new Package();
            // Add a Send Mail task to the package.
            Executable exec = pkg.Executables.Add("STOCK:SendMailTask");

            // Cast the task to its own class.
            TaskHost th = exec as TaskHost;
            SendMailTask smTask = th.InnerObject as SendMailTask;

            // Display the properties inherited from Task.
            Console.WriteLine("ExecutionValue: {0}", smTask.ExecutionValue);
            Console.WriteLine("Version: {0}", smTask.Version);
            Console.WriteLine("WaitForMe: {0}", smTask.WaitForMe);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Tasks.SendMailTask
 
Namespace Microsoft.SqlServer.SSIS.Samples
    Class Program
        Shared  Sub Main(ByVal args() As String)
            Dim app As Application =  New Application() 
            Dim pkg As Package =  New Package() 
            ' Add a Send Mail task to the package.
            Dim exec As Executable =  pkg.Executables.Add("STOCK:SendMailTask") 
 
            ' Cast the task to its own class.
            Dim th As TaskHost =  exec as TaskHost 
            Dim smTask As SendMailTask =  th.InnerObject as SendMailTask 
 
            ' Display the properties inherited from Task.
            Console.WriteLine("ExecutionValue: {0}", smTask.ExecutionValue)
            Console.WriteLine("Version: {0}", smTask.Version)
            Console.WriteLine("WaitForMe: {0}", smTask.WaitForMe)
        End Sub
    End Class
End Namespace

サンプル出力 :

ExecutionValue:

Version: 0

WaitForMe: True