ForEachEnumeratorHost.Validate 方法

定義

可讓主機判斷是否有無效設定,因而無法順利執行 ForEachEnumerator

public:
 virtual Microsoft::SqlServer::Dts::Runtime::DTSExecResult Validate(Microsoft::SqlServer::Dts::Runtime::Connections ^ connections, Microsoft::SqlServer::Dts::Runtime::VariableDispenser ^ variableDispenser, Microsoft::SqlServer::Dts::Runtime::IDTSInfoEvents ^ infoEvents, Microsoft::SqlServer::Dts::Runtime::IDTSLogging ^ log);
public Microsoft.SqlServer.Dts.Runtime.DTSExecResult Validate (Microsoft.SqlServer.Dts.Runtime.Connections connections, Microsoft.SqlServer.Dts.Runtime.VariableDispenser variableDispenser, Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents infoEvents, Microsoft.SqlServer.Dts.Runtime.IDTSLogging log);
abstract member Validate : Microsoft.SqlServer.Dts.Runtime.Connections * Microsoft.SqlServer.Dts.Runtime.VariableDispenser * Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents * Microsoft.SqlServer.Dts.Runtime.IDTSLogging -> Microsoft.SqlServer.Dts.Runtime.DTSExecResult
override this.Validate : Microsoft.SqlServer.Dts.Runtime.Connections * Microsoft.SqlServer.Dts.Runtime.VariableDispenser * Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents * Microsoft.SqlServer.Dts.Runtime.IDTSLogging -> Microsoft.SqlServer.Dts.Runtime.DTSExecResult
Public Function Validate (connections As Connections, variableDispenser As VariableDispenser, infoEvents As IDTSInfoEvents, log As IDTSLogging) As DTSExecResult

參數

connections
Connections

ForEachEnumerator 所使用之連接的集合。

variableDispenser
VariableDispenser

用於鎖定變數的 VariableDispenser 物件。

infoEvents
IDTSInfoEvents

實作 IDTSInfoEvents 介面的物件。

log
IDTSLogging

實作 IDTSLogging 介面的物件。

傳回

DTSExecResult

表示驗證結果的 DTSExecResult 列舉。

實作

範例

下列程式碼範例示範如何使用物件的方法來驗證物件 Validate Package

DTSExecResult myresult = pkg.Validate(myPkgConnections, myPkgVariables, myIDTSEvents, myIDTSLogging);  
Dim myresult As DTSExecResult =  pkg.Validate(myPkgConnections,myPkgVariables,myIDTSEvents, myIDTSLogging)  

備註

Validate方法會審核屬性和設定是否有不正確或不正確的設定。 方法不會觸控資料,也不會連接到資料來源來驗證連接。 但是,它可確保填入必要欄位,並包含適當的值。 經過驗證的欄位會因正在驗證的物件而有所不同。

的主要用途 Validate 是在撰寫自訂工作時。 當 Validate 設定屬性時,SSIS 設計工具會呼叫此方法,而當工作卸載至設計介面上時,它可能會多次。 但是在程式碼中, Validate 不常使用個別物件上的方法,因為建議您在 Validate Package 需要驗證物件時,在上呼叫方法。 但是,如果您在需要的情況下找出獨特的情況,就可以在個別物件上使用方法。

Validate方法會在自訂工作中覆寫,以在 SSIS 設計工具中使用時或由程式碼呼叫時,用於驗證物件。 如需撰寫自訂工作之方法的詳細資訊 Validate ,請參閱撰寫 自訂工作的程式碼。

適用於