I'm trying to execute:
var DrgFileDir = Directory.GetFiles(@"C:\Source", "Drg*.txt");
if (DrgFileDir != null)
{
Dts.Variables["DrgFileName"].Value = DrgFileDir;
}
I'm getting following error:
Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException: The type of the value being assigned to variable "User::DrgFileName" differs
from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.
---> System.Runtime.InteropServices.COMException (0xC001F009): The type of the value being assigned to variable "User::DrgFileName" differs from the current variable type. Variables may not change type during execution. Variable types are
strict, except for variables of type Object.
"DrgFileName" is String Variable in SSIS package.
ZK