Udostępnij za pośrednictwem


Właściwość DtsContainer.Disable

A wartość logiczna wskazuje, że jeśli DtsContainer obiekt jest wyłączone.

Przestrzeń nazw:  Microsoft.SqlServer.Dts.Runtime
Zestaw:  Microsoft.SqlServer.ManagedDTS (w Microsoft.SqlServer.ManagedDTS.dll)

Składnia

'Deklaracja
Public Property Disable As Boolean
    Get
    Set
'Użycie
Dim instance As DtsContainer
Dim value As Boolean

value = instance.Disable

instance.Disable = value
public bool Disable { get; set; }
public:
property bool Disable {
    bool get ();
    void set (bool value);
}
member Disable : bool with get, set
function get Disable () : boolean
function set Disable (value : boolean)

Wartość właściwości

Typ: System.Boolean
A wartość logiczna wskazuje, że jeśli obiekt jest wyłączona.Jeśli true, DtsContainer jest wyłączone, a obiekt nie będzie wykonać.

Uwagi

Wartością domyślną jest false.

Przykłady

Package Klasy implementuje DtsContainer poprzez dziedziczenie jego EventsProvider.Poniższy przykład kodu tworzy pakiet, a następnie wyświetla i ustawia wartości dziedziczone z DtsContainer.

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

namespace Microsoft.SqlServer.SSIS.Samples
{
    class Program
    {
        static void Main(string[] args)
        {
            // The package is the ExecuteProcess package sample 
            // that is installed with the SSIS samples.
            string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";

            Application app = new Application();
            Package p1 = app.LoadPackage(pkg, null);

            // Show the properties inherited from DtsContainer.
            Console.WriteLine("CreationName:    {0}", p1.CreationName);
            Console.WriteLine("DebugMode:       {0}", p1.DebugMode);
            Console.WriteLine("DelayValidation: {0}", p1.DelayValidation);
            Console.WriteLine("Description:     {0}", p1.Description);
            Console.WriteLine("Disable:         {0}", p1.Disable);

            // Description is not set for this sample, so set it.
            p1.Description = "This is the Execute Process Package Sample";
            Console.WriteLine("Description after modification: {0}", p1.Description);

            Console.WriteLine();
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
 
Namespace Microsoft.SqlServer.SSIS.Samples
    Class Program
        Shared  Sub Main(ByVal args() As String)
            ' The package is the ExecuteProcess package sample 
            ' that is installed with the SSIS samples.
            Dim pkg As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx" 
 
            Dim app As Application =  New Application() 
            Dim p1 As Package =  app.LoadPackage(pkg,Nothing) 
 
            ' Show the properties inherited from DtsContainer.
            Console.WriteLine("CreationName:    {0}", p1.CreationName)
            Console.WriteLine("DebugMode:       {0}", p1.DebugMode)
            Console.WriteLine("DelayValidation: {0}", p1.DelayValidation)
            Console.WriteLine("Description:     {0}", p1.Description)
            Console.WriteLine("Disable:         {0}", p1.Disable)
 
            ' Description is not set for this sample, so set it.
            p1.Description = "This is the Execute Process Package Sample"
            Console.WriteLine("Description after modification: {0}", p1.Description)
 
            Console.WriteLine()
        End Sub
    End Class
End Namespace

Przykładowe dane wyjściowe:

CreationName: SSIS.Package.2

DebugMode: False

DelayValidation: True

Description:

Disable: False

Description after modification: This is the Execute Process Package Sample