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:
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
Post a Comment