title: How to insert row at any desired position in datatable?
body: <p>I have a datatable which contains 10 rows. I now need to insert 11th row at the position specified by some conditions.</p>
  
  <p>I have tried the InsertAt method but that gives the error of "this row already belongs to another table".</p>
  
  <p>I cannot use ImportRow method as that simply import the rows into datatable and inserts the row at the end of the existing rows.</p>
  
  <p>What should i do? Kindly help! </p>
  
  <p>Thanks</p>
  
  <p><strong>UPDATED CODE</strong></p>
  
  <pre><code>        int iCount = 0;
          foreach (DataRow dr in dtWithBundle.Rows)
          {
              DataRow drClone = dtOppClone.NewRow();
              drClone.ItemArray = dr.ItemArray;
              dtOpps.Rows.InsertAt(drClone, iIndex + iCount);
              //dtOpps.ImportRow(drClone);
              //dtOpps.Rows.Add(drClone.ItemArray); // Commented on Aug-4 2011 1700HRS
              iCount++;
              dtOpps.AcceptChanges();
          }
  </code></pre>