0

I want to import columns via the script component in SSIS. As output I created Col1 to Col50. Usually I would use

File1OutputBuffer.Col1 = columns[0];

but since the column length is not identical I would like to set a loop like

    Dim count As Integer = 1
    For Each colInfo As Columns_ITIM In columnInfos
        File1OutputBuffer.Col & count = colInfo.code

        count = count + 1
    Next

Is it possible to accomplish this somehow? I already tried File1OutputBuffer.["Col" & count] but this is not working.

What I want to accomplish.

Let us say the first Dataset has 3 Columns then:

File1OutputBuffer.Col1 = colInfo.code
File1OutputBuffer.Col2 = colInfo.code
File1OutputBuffer.Col3 = colInfo.code

the second Dataset has 5 Columns then:

File1OutputBuffer.Col1 = colInfo.code
File1OutputBuffer.Col2 = colInfo.code
File1OutputBuffer.Col3 = colInfo.code
File1OutputBuffer.Col4 = colInfo.code
File1OutputBuffer.Col5 = colInfo.code
Hadi
  • 36,233
  • 13
  • 65
  • 124
ruedi
  • 5,365
  • 15
  • 52
  • 88
  • I don't understand - do you mean that the number of columns in each spreadsheet can differ? If so, maybe amend your question from "but since each spreadsheet can have a different number of columns I would like to set a loop like" to "but since the column length is not identical I would like to set a loop like" – BIDeveloper Jun 08 '16 at 11:46
  • I wanted to be more abstract since my data are coming from a Rest API not a spreadsheet. In that Rest API I have Surveydata and the Questionaires do not have the same number of columns. I hope this helps a bit to understand the problem. I also edited my question a bit to sho an example. – ruedi Jun 08 '16 at 12:07

0 Answers0