When reading a CSV file using a DataReader and the OLEDB Jet data provider, how can I control column data types?

前端 未结 4 1280
难免孤独
难免孤独 2020-11-30 06:40

In my C# application I am using the Microsoft Jet OLEDB data provider to read a CSV file. The connection string looks like this:

Provider=Microsoft.Jet.OLEDB         


        
4条回答
  •  被撕碎了的回忆
    2020-11-30 07:30

    There's a schema file you can create that would tell ADO.NET how to interpret the CSV - in effect giving it a structure.

    Try this: http://www.aspdotnetcodes.com/Importing_CSV_Database_Schema.ini.aspx

    Or the most recent MS Documentation

提交回复
热议问题