Link to home
Create AccountLog in
Avatar of onesegun
onesegunFlag for United Kingdom of Great Britain and Northern Ireland

asked on

SSIS: Use Variable in C# Script task

Hi there,

How can I pass the following user defined variable to a C# script task. It's basically the folder path:

User defined variable is:
User::Source_Folder = \\14.100.26.12\dashboard

Open in new window


and the C# code I want to replace it with is the path as indicated below:
        public void Main()
        {
            string[] files = System.IO.Directory.GetFiles(@"\\14.100.26.12\dashboard", "AGINGANALYSIS*.txt", System.IO.SearchOption.TopDirectoryOnly);
            System.IO.FileInfo finf;

Open in new window


Thanks,

OS
ASKER CERTIFIED SOLUTION
Avatar of chaau
chaau
Flag of Australia image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of onesegun

ASKER

Thanks Chaau. I knew I had to assign the SSIS variables to a declared variable inside the script but was frustrated by the syntax.