我正在尝试在自定义PipelineComponent
中读取包变量public override void PreExecute()
{
IDTSVariable100 vars2 = null;
VariableDispenser.LockForRead("System::databse");
VariableDispenser.GetVariables(out vars2);
}
VariableDispenser.GetVariables(out vars2)给了我错误
"The best overloaded method match for
"Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSVariableDispenser100.GetVariables(out Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSVariables100)'
has some invalid argument.
答案 0 :(得分:1)
嗯,除了IDTSVariableDispenser100
接口是“supports the SQL Server infrastructure and is not intended to be used directly from your code”的API之一这一事实外,您已声明vars2
的类型错误。 IDTSVariableDispenser100.GetVariables方法采用类型为out
的{{1}}参数,而不是IDTSVariables100
。 (注意“s”。)