March 7, 2011 at 6:01 am
Hi all
I am very new to VB.NET. I am facing problem with configuring script task. I have 3 package variables. And I need to access them in script task. If two variables have same value I need to set the value of 3rd variable value to 1 otherwise value to be inserted is 0.
Please help me how to acheive this.
Thanks
March 7, 2011 at 6:24 am
For this first you need to specify the variables in the ReadOnlyVariables or the ReadWrite Variables in the script task editor.Then in the Design script
Dim Variable1 As String = Dts.Variables("Variable1 ").Value.ToString()
Dim Variable2 As String = Dts.Variables("Variable2 ").Value.ToString()
if(Variable1 == Variable2 ) then
Dts.Variables("Variable3 ").Value = 1
else
Dts.Variables("Variable3 ").Value = 0
end if
March 7, 2011 at 6:32 am
I ran into this issue myself recently. I can't remember how I solved it, but I found some good examples by searching the web and modified those. The code posted by ramarkishna will start you off - but don't be afraid to search wider and use what you find... after thorough testing, of course!
John
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply