Casting string in SSIS script task for for loop in C# -


i've spent on hour finding solution problem - i'm curious why works. getting error in ssis when executed package:

enter image description here

i had script task accessing variable. i'd correctly added readonlyvariables collection script task, , confident i'd used right case. here script line wasn't working:

string texttowrite = (string)dts.variables["user::testnumber"].value; 

eventually changed to:

string texttowrite = dts.variables["user::testnumber"].value.tostring(); 

and worked ok. question is: why did fail before?

if test number integer exception thrown first line of code because there no type conversion defined int32 string , that's why have tostring()


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -