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

Use SSIS Variable in another class outside of ScriptMain.cs

$
0
0
Hi

The problem I am trying to solve is use a SSIS Variable in another class outside of ScriptMain.cs in the SSIS Script Task. I am trying to use a constructor and get the variables read in other methods. Could you please guide me in the right direction. 

using System.IO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    public void Main()
    {
        var game = Dts.Variables["User::varGame"].Value.ToString();
	var score = Dts.Variables["User::varScore"].Value.ToString();

        result res = new result(game, score);
    }

    public class result
    {
        string gamenumber;
	string scorecard;

        public result(string game, string score)
        {
           gamenumber = game;
           scorecard = score;
        }
    }
}



Thanks in advance.

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>