title: Using OleDbConnection to Read Tab-Separated File
body: <p>My tab-delimited file is something like this:</p>
  
  <pre><code>ISO ISO3    ISO-Numeric
  AD  AND 20
  </code></pre>
  
  <p>I've been trying the following code with no luck.</p>
  
  <pre><code>OleDbConnection cn = new  OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source= |DataDirectory|;Extended Properties='text;HDR=Yes;FMT=TabDelimited'");
  OleDbCommand cmd = new OleDbCommand(@"SELECT * FROM countryInfo.txt", cn);
  OleDbDataAdapter da = new OleDbDataAdapter(cmd);
  
  cn.Open();
  
  DataTable dt = new DataTable();
  da.Fill(dt);
  </code></pre>
  
  <p>Here's a screenshot of the Dataset Visualizer. Its obviously not the output i'm after.
  <img src="https://i.stack.imgur.com/ZCSPP.jpg" alt="alt text"></p>
  
  <p>Any suggestions? Here's my Schema.ini file. Its in the same directory as the text file.</p>
  
  <pre><code>[countryInfo.txt]
  Format=TabDelimited
  ColNameHeader=True
  CharacterSet=ANSI
  </code></pre>
  
  <p>Should i just use something like <a href="http://www.filehelpers.com/" rel="nofollow noreferrer">FileHelpers</a> instead?</p>
  
  <hr>
  
  <p>@Hans Passant Here's a screenshot.
  <img src="https://i.stack.imgur.com/5C3aK.jpg" alt="alt text"></p>