Export (0) Print
Expand All

Task.Version Property

 

Applies To: SQL Server 2016 Preview

*** Member deprecated; see Remarks. ***   Returns the version of the task. This property is read-only.

Namespace:   Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

public virtual int Version { get; }

Property Value

Type: System.Int32

An Integer that contains the task version number.

System_CAPS_noteNote

This member will be removed in a future version of MicrosoftSQL Server. Avoid using this member in new development work, and plan to modify applications that currently use this member.

Legacy Code Example

The following code example creates the Send Mail task, which inherits from Task, and then displays the properties is has inherited.

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);
        }
    }
}

Sample Output:

ExecutionValue:

Version: 0

WaitForMe: True

Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft