Missing column of Dates in CSV file using Schema.ini file

后端 未结 1 1005
误落风尘
误落风尘 2021-01-24 13:51

Note: answering my own problem to help others in future.


I\'m reading a CSV file with OleDB:

DataTable csvTableSchema = new DataTable();         


        
相关标签:
1条回答
  • 2021-01-24 14:06

    Turns out OleDB uses nn instead of mm for minutes in DateTimes.

    So the correct syntax is:

    DateTimeFormat=dd MM yyyy hh:nn:ss

    Ref stashed in the internet: http://forums.codeguru.com/showthread.php?333106-schema-ini-DateTimeFormat-legal-values

    I couldn't see this in the official documentation: https://docs.microsoft.com/en-us/sql/odbc/microsoft/schema-ini-file-text-file-driver

    0 讨论(0)
提交回复
热议问题