title: Reading Comma Delimited Text File to C# DataTable, columns get truncated to 255 characters
body: <p>We are importing from CSV to SQL. To do so, we are reading the CSV file and writing to a temporary .txt file using a schema.ini. (I'm not sure yet exactly why are are writing to this temporary file, but that's how the code currently works).  From there, we are loading a DataTable via OleDB using the following connection string (for ASCII files).</p>
  
  <pre><code>"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sPath + ";Extended Properties=\"text;HDR=Yes;FMT=Delimited\"";
  </code></pre>
  
  <p>The problem we are having is that fields with more than 255 characters get truncated. I've read online about this problem and it seems that by default, text fields get truncated thusly.</p>
  
  <p>I set my registry settings  <code>ImportMixedTypes=Majority Type</code> and <code>TypeGuessRows=0</code> in <code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel</code>
  , hoping that <code>mycolumns</code> will no longer be interpreted as text. After doing that, the temporary txt file is being written correctly from the CSV file, but when I call <code>dataAdapter.Fill</code>, the resulting DataTable still has a truncated value.</p>
  
  <p>Here is the column definition in question. 
   
  CommaDelimited#txt Notes 2 false 234 true 130 0 0 
  </p>
  
  <p>Any help would be appreciated. At this time, I'm not interested in using any 3d party code to solve this problem, there must be a way using built in tools.</p>
  
  <p>Here is the table definition:</p>
  
  <pre><code>&lt;Columns&gt; 
      &lt;TABLE_NAME&gt;CommaDelimited#txt&lt;/TABLE_NAME&gt; 
      &lt;COLUMN_NAME&gt;Notes&lt;/COLUMN_NAME&gt; 
      &lt;ORDINAL_POSITION&gt;2&lt;/ORDINAL_POSITION&gt; 
      &lt;COLUMN_HASDEFAULT&gt;false&lt;/COLUMN_HASDEFAULT&gt; 
      &lt;COLUMN_FLAGS&gt;234&lt;/COLUMN_FLAGS&gt; 
      &lt;IS_NULLABLE&gt;true&lt;/IS_NULLABLE&gt; 
      &lt;DATA_TYPE&gt;130&lt;/DATA_TYPE&gt; 
      &lt;CHARACTER_MAXIMUM_LENGTH&gt;0&lt;/CHARACTER_MAXIMUM_LENGTH&gt; 
      &lt;CHARACTER_OCTET_LENGTH&gt;0&lt;/CHARACTER_OCTET_LENGTH&gt; 
  &lt;/Columns&gt;
  </code></pre>
  
  <p>Thanks,</p>
  
  <p>Greg</p>
  
  <hr>
  
  <p>I tried editing the schema.ini specifying text with a width, and that did not help (it was set to memo before)</p>
  
  <p>[CommaDelimited.txt]
  Format=CSVDelimited
  DecimalSymbol=.
  Col1=Notes Text Width 5000</p>