title: Get Cell Value from a DataTable in C#
body: <p>Here is a <strong>DataTable dt</strong>, which has lots of data. </p>
  
  <p>I want to get the specific <strong>Cell Value</strong> from the DataTable, say <strong>Cell[i,j]</strong>. Where, 
  i -> Rows and j -> Columns. I will iterate i,j's value with two <code>forloops</code>.</p>
  
  <p>But I can't figure out how I can call a cell by its index.</p>
  
  <p>Here's the code: </p>
  
  <pre><code>for (i = 0; i &lt;= dt.Rows.Count - 1; i++)
  {
      for (j = 0; j &lt;= dt.Columns.Count - 1; j++)
      {
          var cell = dt.Rows[i][j];
          xlWorkSheet.Cells[i + 1, j + 1] = cell;
      }
  }
  </code></pre>