ReinitializeMetaData 方法

Repairs any errors identified during validation that cause the component to return VS_NEEDSNEWMETADATA at design time.

命名空间:  Microsoft.SqlServer.Dts.Pipeline
程序集:  Microsoft.SqlServer.PipelineHost(在 Microsoft.SqlServer.PipelineHost.dll 中)

语法

声明
Public Overridable Sub ReinitializeMetaData
用法
Dim instance As PipelineComponent

instance.ReinitializeMetaData()
public virtual void ReinitializeMetaData()
public:
virtual void ReinitializeMetaData()
abstract ReinitializeMetaData : unit -> unit 
override ReinitializeMetaData : unit -> unit 
public function ReinitializeMetaData()

注释

The ReinitializeMetaData method is called in response to the component returning VSNEEDSNEWMETADATA from Validate. Components should implement code that fixes these errors.

示例

public override DTSValidationStatus Validate()
{
    if (!ComponentMetaData.AreInputColumnsValid)
        return DTSValidationStatus.VS_NEEDSNEWMETADATA;
}
public override void ReinitializeMetaData()
{
    if (!ComponentMetaData.AreInputColumnsValid)
        ComponentMetaData.RemoveInvalidInputColumns();
}
Public Overrides Function Validate() As DTSValidationStatus 
 If Not ComponentMetaData.AreInputColumnsValid Then 
   Return DTSValidationStatus.VS_NEEDSNEWMETADATA 
 End If 
End Function 

Public Overrides Sub ReinitializeMetaData() 
 If Not ComponentMetaData.AreInputColumnsValid Then 
   ComponentMetaData.RemoveInvalidInputColumns 
 End If 
End Sub