title: Cannot implicitly convert type string to microsoft.sqlserver.dts.runtime.variable
body: <p>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.        </p>
  
  <pre><code>        String v = Dts.Variables["myVar1"].Value + "";
          String x = Dts.Variables["myVar2"].Value + v + "'";
          Dts.Variables["myVar2"] = SQL;  // Why do I get an error here ?
  </code></pre>
  
  <p>The errors are - </p>
  
  <p>Error   1   Property or indexer 'Microsoft.SqlServer.Dts.Runtime.Variables.this[object]' cannot be assigned to -- it is read only</p>
  
  <p>Error   2   Cannot implicitly convert type 'string' to 'Microsoft.SqlServer.Dts.Runtime.Variable'</p>