title: How to dynamically add (or) insert values to data column in c#?
body: <p>I am iterating an excel file cell by cell. Each file has its own number of columns. Based on excel cell count, we are dynamically creating the columns to the data table. This part is working fine.</p>
  
  <p>I will have to insert each cell value to the data column. How to dynamically add (or) insert values to data column in c#?</p>
  
  <p>In an assumption, excel file has 2 rows and 3 colums</p>
  
  <pre><code>FirstName LastName Location
  ---------------------------
  Albert     B         Miami
  Jackson    C         Tampa
  </code></pre>
  
  <p>I will have to populate the data table / data column with these cell values. Foreach loop iteration is working fine and picking up each cell value. 
  I am stuck on inserting each cell value to the data column / data row.</p>
  
  <pre><code>int iCellCount = 3;  // In this example, i am defining cell count = 3 as static value. In the real time, cell count is picked from the excel file.
  var cellValue = string.Empty;
  DataTable dt = new DataTable();
  foreach (ExcelReportCell excelCell in excelRow) // Iterating the excel cell row by row in the Excel Sheet
  {
      cellValue = excelCell.GetText().ToString(); // cellValue is assigned dynamically through excel file cell by cell iteration logic
      for (int i = 1; i &lt;= iCellCount; i++)
      {
          dt.Columns.Add();
          // Expected to assign each column values
      }
  }
  </code></pre>