title: CRM C# Loop to increment date by one month without affecting the day
body: <p>I am making a loop where part of it will be creating new records and another part - should increment date field by one month without affecting the days, for every new record loop. </p>
  
  <p>For example, default date is 2016/07/19 - dates for new records should go as follow - Record 1 - 2016/08/19; Record 2 - 2016/09/19; Record 3 - 2016/10/19</p>
  
  <p>Here's a snippet of my code</p>
  
  <pre><code>startDate = (DateTime)target["xrm_startDate "];
  while(a&gt;b)
  {
      startDate = startDate.AddMonth(1);
  }
  </code></pre>
  
  <p>With this loop, date is being increased by one month, however days outputted are different, depending on how many days month has.</p>