title: Validation of Excel file data before importing to Database
body: <p>I'm trying to read data from an Excel file to a <code>DataTable</code>. I know that we can assign different <code>DataTypes</code> for a <code>DataColumn</code> when adding columns to a <code>DataTable</code>. So far I have tried the following,</p>
  
  <pre><code>DataTable dt = new DataTable();
  dt.Columns.AddRange(new DataColumn[2]
  {
      new Datacolumn("column1", typeof(string)),
      new DataColumn("column2", typeof(int))
  });
  </code></pre>
  
  <p>And my excel file has data in two columns as follows,</p>
  
  <p>column1------column2</p>
  
  <p>abc----------------230</p>
  
  <p>def----------------230tr</p>
  
  <p>As you can see above, the second row second column has a value of '230tr' which the <code>DataTable</code> should not accept an throw an exception with the invalid data field and row number.</p>
  
  <p>Praveena.</p>