donnytian / Npoi.Mapper

Use this tool to import or export data with Excel file. The tool is a convention based mapper between strong typed object and Excel data via NPOI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

关于 mapper.Take<object>取到的列类型转换失败问题

wulienen opened this issue · comments

看了下源码,数据类型是根据列头以外的第一行数据取,假如第一行是字符串,则这一列的所有数据都会转字符串,假如是数值,这一列就全是double。
但是有一种情况是,这一列既第一行是数值,其他行有字符串,然后字符串转数值会转换失败(比如中文不能转换成数字)。
代码在类 MapHelper.InferColumnDataType
请问能不能 mapper.Take 的时候,所有列设置为字符串类型

fixed in next release