title: XML to Word Table
body: <p>I am trying to create a word table from xml file but the rows are not in their proper order,ie the first element occurs as last row, 2nd as 1st row and so on. Where am i going wrong?   </p>
  
  <pre><code>Word.Table oTable;
  Word.Range wrdRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
  oTable = oDoc.Tables.Add(wrdRng, ds.Tables[0].Rows.Count, ds.Tables[0].Columns.Count, ref oMissing, ref oMissing);
  oTable.Range.ParagraphFormat.SpaceAfter = 6;
  oTable.Borders.InsideLineStyle = Word.WdLineStyle.wdLineStyleSingle;
  oTable.Borders.OutsideLineStyle = Word.WdLineStyle.wdLineStyleSingle;
  for (int r = 1; r &lt;= ds.Tables[0].Rows.Count; r++)
  {
      for (int c = 1; c &lt;= ds.Tables[0].Columns.Count; c++)
      {
          oTable.Cell(r, c).Range.Text = ds.Tables[0].Rows[r-1].ItemArray[c-1].ToString();
      }
  }
  </code></pre>