DtsContainer.DelayValidation 屬性

定義

取得或設定布林值,這個布林值表示是否要延遲到執行時間才驗證工作。 預設值為 false。

public:
 property bool DelayValidation { bool get(); void set(bool value); };
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyCategory(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "PropertyCategoryExecution")]
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "DelayValidationDesc")]
public bool DelayValidation { get; set; }
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyCategory(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "PropertyCategoryExecution")>]
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "DelayValidationDesc")>]
member this.DelayValidation : bool with get, set
Public Property DelayValidation As Boolean

屬性值

Boolean

如果封裝的驗證延遲到執行時間,則為 true。 如果封裝經過驗證,而且在實際執行封裝之前傳回錯誤和警告,則為 false。 false 可能會在發生的錯誤或警告超出 MaximumErrorCount 屬性時,讓封裝無法執行。

屬性

範例

Package類別會 DtsContainer 透過其繼承來執行 EventsProvider 。 下列程式碼範例會建立封裝,然後顯示並設定繼承自的值 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  

範例輸出:

CreationName: MSDTS。Package. 1

DebugMode: False

DelayValidation: True

描述:

停用: False

修改後的描述:這是執行進程封裝範例

備註

在封裝執行之前先進行驗證,是在執行開始之前,尋找一些錯誤的方法。 不過,它會處理封裝以找出錯誤,如果找不到任何錯誤,就會執行封裝。 因為這兩次都會通過封裝,所以驗證封裝會增加封裝的處理數量,因此只有在必要時才應該使用。

適用於