包中包含脚本任务,显示错误
Dts Script task has encountered an exception in user code:
Exception has been thrown by the target of an invocation
脚本任务代码是
public void Main()
{
string Str_Filepath = Dts.Variables["User::FilePath"].Value.ToString();
bool bl_exist=false;
if (System.IO.File.Exists(Str_Filepath))
{
bl_exist = true;
}
else
{ bl_exist = false; }
Dts.Variables["User::V_Exist"].Value = bl_exist;
Dts.TaskResult = (int)ScriptResults.Success;
}
答案 0 :(得分:1)
这只是意味着代码有错误。
您是否将V_Exist数据类型设置为boolean?