I tried to assign a list to a user variable , but it doesn't seems to work. Here is the code, what could be wrong?
StreamReader r = new StreamReader(Dts.Variables["User::filepath"].Value.ToString())
{
string[] a = r.ReadLine().Split(';');
List<string> list = new List<string>(a);
Dts.Variables["User::firstRow"].Value = list;
}
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
that is the error when I run the script in ssis