Reputation: 1119
I created some variables and using the C# script task I am trying to modifying the values of the variables. initial values
Expression Builder image for pine variable
FolderInputPath="D:\"; Pine="C:\abc\qwr";
please find the variable status
the above values were set at the variables in ssis package
string filename = "";
string newname="";
filename = Dts.Variables["User::FolderInputPath"].Value.ToString();
if (filename.Substring(filename.Length - 1, 1) != "\\")
{
filename = filename + "\\";
}
newname = filename + "Pine.txt";
Dts.Variables["User::Pine"].Value = newname;
MessageBox.Show(newname + " before value is " + Dts.Variables["User::Pine"].Value.ToString());
As per the above logic we User::Pine
should have the value "D:\Pine.txt" but when i run the code the value for the variable User::Pine
doesn't change
thanks in advance
Upvotes: 2
Views: 3836
Reputation: 14189
Open the variable pane, click on your variable and press F4 to open the Properties window.
Make sure that "EvaluateAsExpression" and "ReadOnly" are both set to False. Also make sure that the "Expression" field is empty (like the following image). If it's not, select it's text and delete it.
Upvotes: 2