Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Assign result of a method to a variable in script task using C#

$
0
0

Hi, I am using vs 2017 ssdt and would like to assign result of a method to a variable in script task using C#. I am trying to do this outside of main method. I can read the SSIS variable values in the main method but not being able to access it outside of 

public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase { public void Main() { //Do something } private class DiffClass { private Microsoft.SqlServer.Dts.Runtime.Variables DtsVariables; public string MakeURL() { return DtsVariables["User::URLBase"].Value.ToString() + "/default.aspx"; // how to assign this value to the below variable } string urlbase = MakeURL(); //Return results of MakeURL() to the string urlbase

} }


Thank you.


SQLEnthusiast


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>