Error IF variable is mapped to Index 1

  • Hi,

    I am trying to Loop through Excel Files and their Sheets. I have Declared 3 variables namely FilePath, FolderPath,SheetName and assigned defult values to all of them. I have 2 for each loops and 1 Dataflow task to achieve Looping through Excel Files and sheets.

    In the First Foreach loop i Mapped variable FilePath to index 0.

    In the 2nd Foreach Loop i mapped variable SeetName to index 2.

    the above Setup Works Very fine.

    Now, I ran the package by changing the index of sheetname in 2nd Foreach loop to 1 .I get this erro :

    Error: ForEach Variable Mapping number 1 to variable "User::SheetName" cannot be applied.

    I dont know why..

    Any help would be really appreciatedd

    Thanks and Regards

    Chaithanya M

  • How did you configure the For Each Loop containers?

    Which iterators did you use?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Hi Koen,

    I have used two For each loops . One to loop through Excel File in folder and other to loop through excel sheets. I have used Foreach File Enumerator for the first foreach loop and Foreach Ado.net schema rowset enumerator is used fo the second foreach loop.

    Regards

    Chaithanya M

  • All I can say is that the ADO.NET enumerator gives back a resultset with at least 3 columns and the sheetname is the one with index 2. All the others have apparently some datatype that cannot be matched with an SSIS variable of type string.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply