I'm trying to loop and read an object variable(as shown in the pic) where it has the file details(name/size/datemodified) from a share point location. (The varible is passed from an SSIS -Sharepoint task to SCript Task)

I found that an object cannot be used in a foreach enumerator, and i'm not sure how to proceed with this one. Any help is much appreciated.
- using System;
- using System.Data;
- using Microsoft.SqlServer.Dts.Runtime;
- using System.Windows.Forms;
- using System.Data.OleDb;
- public void Main()
- {
- String Filename = "";
- Var fileinfo = Dts.Variables["User::DvarObj"].Value;
- foreach(var i in fileinfo)
- {
- Filename = i.Name;
- MessageBox.Show(Filename);
- }
- Dts.TaskResult = (int)ScriptResults.Success;
- }

Amit GuptaRank #190 · 12.8K reputationPosted May 21, 2020, 8:43 PM EDT
GOWTHAM RAMAMOORTHY10 reputationPosted May 22, 2020, 4:06 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted May 22, 2020, 6:27 AM EDT
GOWTHAM RAMAMOORTHY10 reputationPosted May 22, 2020, 6:53 AM EDT
GOWTHAM RAMAMOORTHY10 reputationPosted May 22, 2020, 6:54 AM EDT
GOWTHAM RAMAMOORTHY10 reputationPosted May 22, 2020, 8:55 AM EDT