title: SSIS foreach with a list of simple objects
body: <p>re: <a href="http://en.wikipedia.org/wiki/SQL_Server_Integration_Services" rel="nofollow noreferrer">SSIS</a> <a href="http://msdn.microsoft.com/en-us/library/ms141724.aspx" rel="nofollow noreferrer">Foreach</a> Loop task with a Variable:</p>
  
  <p>I have this working for a List of primitive objects (e.g. a list of strings, as discussed in <a href="https://stackoverflow.com/questions/3674364/how-to-use-list-collection-for-foreach-in-ssis">this question</a>)</p>
  
  <p>But how do you configure an SSIS ForEach task to loop through a <code>List&lt;Dog&gt;</code> or array <code>Dog[]</code> where <code>Dog</code> is a simple object like this:</p>
  
  <pre><code>public class Dog {
      public string Name{ get; set;}
      public string BestTrick{ get; set;}
  }
  </code></pre>
  
  <p>Lets say I'm trying to get <code>Name</code> and <code>BestTrick</code> into two string loop variables for use inside the loop.</p>
  
  <p>Mapping variables to position 0 and 1 on the 'variable mappings' tab doesn't seem to do it. </p>