title: Input array is longer than the columns in this table
body: <p>I have a <code>csv_log_reader</code>:</p>
  
  <pre><code>DataTable csvData = new DataTable();
  
  try
  {
      using (TextFieldParser csvReader = new TextFieldParser(csv_file_path))
      { 
          csvReader.SetDelimiters(new string[] { "," });
          csvReader.HasFieldsEnclosedInQuotes = true;
  
          string[] colFields = csvReader.ReadFields();
  
          foreach (string column in colFields)
          {
              DataColumn datecolumn = new DataColumn(column);
              datecolumn.AllowDBNull = true;
              csvData.Columns.Add(datecolumn);
          }
  
          while (!csvReader.EndOfData)
          {
              string[] fieldData = csvReader.ReadFields();
  
              // Making empty value as null.
              for (int i = 0; i &lt; fieldData.Length; i++)
              {
                  if (fieldData[i] == "")
                  {
                      fieldData[i] = null;
                  }
              }    
  
          csvData.Rows.Add(fieldData);
          }
      }
  }
  
  catch (Exception ex)
  {
      MessageBox.Show(ex.Message);
  }
  
  return csvData;
  </code></pre>
  
  <p>For the first csv file, I have 9 headers. For the second csv file, I have 10 headers, but the 10th header is null. For the second file, there is an exception thrown:</p>
  
  <blockquote>
    <p>Input array is longer than the number of columns in this table.</p>
  </blockquote>
  
  <p>I want the 10th header's value to be <code>null</code>. How do I do this only for the 10th header?</p>