title: Should AcceptChanges() be called every time a new row is added?
body: <p>Which is recommended</p>
  
  <pre><code>while (reader.Read())  
  {
      table.Rows.Add(
              new object[] { reader[0], reader[1], reader[2], reader[3] }
      );  
      table.AcceptChanges();
  }  
  </code></pre>
  
  <p>or</p>
  
  <pre><code>while (reader.Read())  
  {
      table.Rows.Add(
              new object[] { reader[0], reader[1], reader[2], reader[3] }
      );  
  }  
  table.AcceptChanges();
  </code></pre>
  
  <p>Note where the table.AcceptChanges is placed.</p>
  
  <hr>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>Here is the code block:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      IDataReader reader = cust.GetCustomerOrderSummary("99999");
      using (DataSet ds = new DataSet())
      {
          using (DataTable table =
                  new DataTable { TableName = "OrderSummary" })
          {
              DataColumn idColumn = table.Columns.Add("number", typeof(int));
              table.Columns.Add("name", typeof(string));
              table.Columns.Add("quantity", typeof(int));
              table.Columns.Add("prev_quantity", typeof(int));
              table.PrimaryKey = new DataColumn[] { idColumn };
              while (reader.Read())
              {
                  table.Rows.Add(
                    new object[]{ reader[0], reader[1], reader[2], reader[3] }
                  );
                  table.AcceptChanges();
              }
              ds.Tables.Add(table);
              rptCustomerOrder report =
                      new rptCustomerOrder { DataSource = ds };
              ReportViewer1.Report = report;
          }
      }
  }
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT 2</strong><br>
  After reading the MSDN article <a href="http://msdn.microsoft.com/en-us/library/system.data.dataset.acceptchanges.aspx" rel="nofollow noreferrer">here</a> I decided to place the AcceptChanges() outside the loop based on the following statement (from the article):</p>
  
  <blockquote>
    <p>Calling AcceptChanges at the DataTable level causes the AcceptChanges method for each DataRow to be called.</p>
  </blockquote>