title: C# reflection. Target exception was unhandled
body: <pre><code>NetworkElementCountersFactory factory=new NetworkElementCountersFactory();
  List&lt;NetworkElementCounters&gt; neCountersList= new List&lt;NetworkElementCounters&gt;();
  NetworkElementCounters neCounters;
  while (reader.Read())
  {
      i = 4;
      neCounters = factory.getInstance(tableName, reader.GetInt32(0), reader.GetDateTime(1), reader.GetDateTime(2), reader.GetInt32(3));
      foreach (var v in neCounters.Fields)
      {
          v.GetType().GetProperty("CounterValue").SetValue(neCounters.GetType(), reader.GetValue(i), null);
          i++;
      }
      neCountersList.Add(neCounters);
  } 
  </code></pre>
  
  <p>I receive the exception here:</p>
  
  <pre><code>v.GetType().GetProperty("CounterValue").SetValue(neCounters.GetType(), reader.GetValue(i), null);
  </code></pre>