Importing from Excel - non-numeric values are ignored

前端 未结 2 1188
误落风尘
误落风尘 2021-01-20 00:51

I have code that imports from Excel sheets of a specified format. In one of the columns, most data is numeric, but non-numeric values are also present. The non-numeric value

2条回答
  •  囚心锁ツ
    2021-01-20 01:35

    What I have noted is that the Engine infers the data type of the column from the first value in the column.

    So, if your first value is numeric, the engine will assume the column as numeric and when trying to convert a alpha value to numeric will fail.

    What i Have usually done is append an underscore to all the values on Excel, and then, up on SQL or on DataSet, to make the replace of the first underscore. Hope it will helps

提交回复
热议问题