IDTSDesigntimeComponent100.ReinitializeMetaData 方法

定义

修复在设计时验证过程中确定的导致组件返回 VS_NEEDSNEWMETADATA 的任何错误。

public:
 void ReinitializeMetaData();
[System.Runtime.InteropServices.DispId(12)]
public void ReinitializeMetaData ();
[<System.Runtime.InteropServices.DispId(12)>]
abstract member ReinitializeMetaData : unit -> unit
Public Sub ReinitializeMetaData ()
属性

示例

以下示例调用 ReinitializeMetaData 响应组件验证失败。

Package p = new Package();  
MainPipe dataFlow = ((TaskHost)p.Executables.Add("DTS.Pipeline")).InnerObject as MainPipe;  

IDTSComponentMetaData100 md = dataFlow.ComponentMetaDataCollection.New();  
md.ComponentClassID = "DTSAdapter.OleDbSource";  
CManagedComponentWrapper wrp = md.Instantiate();  
wrp.ProvideComponentProperties();  

if (wrp.Validate() == DTSValidationStatus.VS_NEEDSNEWMETADATA)  
{  
    wrp.ReinitializeMetaData();  
}  
Dim p As Package = New Package   
Dim dataFlow As MainPipe = CType(CType(p.Executables.Add("DTS.Pipeline"), TaskHost).InnerObject, MainPipe)   
Dim md As IDTSComponentMetaData100 = dataFlow.ComponentMetaDataCollection.New   
md.ComponentClassID = "DTSAdapter.OleDbSource"   
Dim wrp As CManagedComponentWrapper = md.Instantiate   
wrp.ProvideComponentProperties  

If wrp.Validate = DTSValidationStatus.VS_NEEDSNEWMETADATA Then   
 wrp.ReinitializeMetaData   
End If  

注解

ReinitializeMetaData响应从Validate中返回的VS_NEEDSNEWMETADATA组件时调用该方法。 在此方法期间,如果组件可以修复这些错误,则组件会修复所识别 Validate的任何错误。

适用于