Changing an SSIS dts variables

只愿长相守 提交于 2019-12-24 19:01:16

问题


In an SSIS package I have a For..Each container that enumerates all (.) the files in a folder.

In that For..Each container I have a component-level variable 'fileComments' of DataType 'String'.

In that For..Each container I have a script task. With a ReadWrite entry for 'filecomments' (amongst others)

In that script task, I have some code :-

Dim Comments As String = Dts.Variables("User::fileComments").ToString

which allows me to read the value of that variable, but if I try to allocate a value back to that variable, I get a Property 'Item' is 'ReadOnly' blue squiggly underline.

How do I change the vlaue of that variable (or get the value out of the script task so I can use it later in the flow) ?

Thanks in advance.


回答1:


your problem is a common trap check this article out:

http://www.programmersedge.com/?p=1350

you basically need to use the Dts.VariableDispenser object to lock or declare the variable as read / write in the script task.



来源:https://stackoverflow.com/questions/3202439/changing-an-ssis-dts-variables

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!