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

Script task - Assign List to an Object Variable

$
0
0

Hi all,

Wonder if anyone can help.

I am trying to load an Object Variable with the results of an array.

But when I show the object variable via a message box I get this:

System.String[]

In the code I display a message box with a random array element to verify the data looks okay.

Any idea ?

Here is my code

        private void GetSecuritiesData()
        {
            int StartOfData = AllLines.IndexOf("START-OF-DATA") + 1;
            int EndOfData = AllLines.IndexOf("END-OF-DATA") - 1;

            for (int i = StartOfData; i <= EndOfData; i++)
            {
                SecuritiesData.Add(AllLines[i].ToString());
            }
            MessageBox.Show(SecuritiesData[10]);
            string[] s = SecuritiesData.ToArray();
            Dts.Variables["OutFileSecData"].Value = s;
            MessageBox.Show(Dts.Variables["OutFileSecData"].Value.ToString());
        }


Viewing all articles
Browse latest Browse all 24688

Trending Articles



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