Language

ForEachSMOEnumerator.Validate メソッド

定義

コンテナの不正な設定で正常に動作しないかどうかを示す値を返します。

public:
 override Microsoft::SqlServer::Dts::Runtime::DTSExecResult Validate(Microsoft::SqlServer::Dts::Runtime::Connections ^ connections, Microsoft::SqlServer::Dts::Runtime::VariableDispenser ^ variableDispenser, Microsoft::SqlServer::Dts::Runtime::IDTSInfoEvents ^ events, Microsoft::SqlServer::Dts::Runtime::IDTSLogging ^ log);
public override Microsoft.SqlServer.Dts.Runtime.DTSExecResult Validate(Microsoft.SqlServer.Dts.Runtime.Connections connections, Microsoft.SqlServer.Dts.Runtime.VariableDispenser variableDispenser, Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents events, Microsoft.SqlServer.Dts.Runtime.IDTSLogging log);
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 Overrides Function Validate (connections As Connections, variableDispenser As VariableDispenser, events As IDTSInfoEvents, log As IDTSLogging) As DTSExecResult

パラメーター

connections
Connections

コンテナのコレクション Connections 。

variableDispenser
VariableDispenser

コンテナのコレクション VariableDispenser 。

events
IDTSInfoEvents

イベントを起こすための IDTSInfoEvents インターフェース。

log
IDTSLogging

IDTSLogging インターフェイスです。

返品

検証の結果を示す DTSExecResult 列挙。

例

以下のコード例は、PackageオブジェクトのValidateメソッドを使ってオブジェクトを検証する方法を示しています。

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

注釈

Validateメソッドは、プロパティや設定の不正確さや誤った設定をレビューします。 この手法はデータに触れず、接続を検証するためにデータソースに接続しません。 しかし、必要なフィールドが入力され、適切な数値が含まれていることが保証されます。 検証されるフィールドは、検証対象のオブジェクトによって異なります。

Validateの主な用途はカスタムタスクを書く際です。 Validateメソッドは、タスクが設計面にドロップされた際にSSISデザイナーによって呼び出され、プロパティ設定時に複数回呼び出されることがあります。 しかし、コード上では個々のオブジェクトに対するValidateメソッドはあまり使われず、オブジェクトの検証が必要な場合はPackage上でValidateメソッドを呼び出すことが推奨されています。 ただし、必要に応じて個別の物体でこの方法が利用可能です。

Validateメソッドはカスタムタスクで上書きされ、SSISデザイナーでオブジェクトの検証やコード呼び出時に上書きされます。 カスタムタスクの Validate メソッドの作成についての詳細は、「 カスタムタスクのコーディング」をご覧ください。

適用対象