title: OleDB & mixed Excel datatypes : missing data
body: <p>I have an Excel worksheet I want to read into a datatable - all is well except for one particular column in my Excel sheet. The column, 'ProductID', is a mix of values like <code>##########</code> and <code>n#########</code>.</p>
  
  <p>I tried to <a href="http://support.microsoft.com/kb/306572">let OleDB handle everything by itself automatically</a> by reading it into a dataset/datatable, but any values in 'ProductID' like <code>n######</code> are missing, ignored, and left blank.  I tried manually creating my DataTable by looping through each row with a datareader, but with the exact same results.</p>
  
  <p>Here's the code :</p>
  
  <pre class="lang-cs prettyprint-override"><code>// add the column names manually to the datatable as column_1, column_2, ...
  for (colnum = 0; colnum &lt; num_columns; colnum ++){
    ds.Tables["products"].Columns.Add("column_" +colnum , System.Type.GetType("System.String")); 
  }
  while(myDataReader.Read()){
    // loop through each excel row adding a new respective datarow to my datatable 
    DataRow a_row = ds.Tables["products"].NewRow();
    for (col = 0; col &lt; num_columns; col ++){
      try {  a_row[col] = rdr.GetString(col);  }
      catch {  a_row[col] = rdr.GetValue(col).ToString(); }
    }
    ds.Tables["products"].Rows.Add(a_row);
  }
  </code></pre>
  
  <p>I don't understand why it won't let me read in values like <code>n######</code>. How can I do this? </p>