I am trying to store a String inside a Dts variable in visual c# / visual c sharp. But, I get the error below. How do I fix this ? I have not used C# before so its hard for me to figure out. I do know Java well though.
String v = Dts.Variables["myVar1"].Value + "";
String x = Dts.Variables["myVar2"].Value + v + "'";
Dts.Variables["myVar2"] = SQL; // Why do I get an error here ?
The errors are -
Error 1 Property or indexer 'Microsoft.SqlServer.Dts.Runtime.Variables.this[object]' cannot be assigned to -- it is read only
Error 2 Cannot implicitly convert type 'string' to 'Microsoft.SqlServer.Dts.Runtime.Variable'