I have parsing a CSV via the Microsoft.Jet.OLEDB.4.0 provider. Which has been working fine for most of our tasks, but recently I’ve noticed an issue.
I have a CSV which has a column called Rating, this is generally an integer but occasionally it will be “1-2” or a Date e.g “1/1/2010”. The datatable I am importing it into has had its columns explicitly set to strings but when a non-integer field is read it is null instead.
Any ideas how I get round this??
Use a schema.ini file (in the folder that contains your .csv) and specify the columns data types correctly.