WebServiceTask.Validate 方法

定义

验证该 Web 服务组件已正确配置。

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

参数

connections
Connections

任务使用的连接的集合。

variableDispenser
VariableDispenser

一个用来锁定变量的 VariableDispenser 对象。

events
IDTSComponentEvents

一个实现 IDTSComponentEvents 接口的对象。

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 自定义任务的方法的详细信息,请参阅 编写自定义任务的代码

适用于