NPOI 导入excel 的 奇葩有关问题

NPOI 导入excel 的 奇葩问题
使用NPOI 导入excel  相同 的代码 导入 不同 的excel  时  数据 不一致
两个 excel  结构 是相同 的 
NPOI  导入excel 的 奇葩有关问题
这是 第一个 excel 数据源
NPOI  导入excel 的 奇葩有关问题
这是 第一个  excel 数据源 导入时 转换 dt  之后的数据

NPOI  导入excel 的 奇葩有关问题
这是 第二个 excel 数据源
NPOI  导入excel 的 奇葩有关问题
这是 第二个 excel 数据源 转换 dt 之后的数据

相同 的代码 读取 两个 excel  时  数据 出现 问题 是什么原因呢
------解决方案--------------------
引用:
Quote: 引用:

Quote: 引用:

Quote: 引用:

你确定读的第二个Excel是截图的那个,读出来的列都不一样,第二个Excel分类条件后面没有列而读取出来的有列,明显对不上

版主 在不 
 加我 QQ 我远程 演示 一下  
你帮我看看 
我 现在 怀疑 是 第二个  excel 的问题


你把第二个Excel 上传资源给我看看

版主 还在吗?
我这就上传这是下载地址
是 第二个 


资源被删了
------解决方案--------------------
看了一下,代码写的超复杂
GetValueTypeForXLSX封装好了怎么不用呢,用它来直接判断单元格类型,对应的读,而不是根据列名写死.
那同一列的不同行,有的是数字,有的是文本,不出错才怪.


            if (cell == null)
                return null;
            switch (cell.CellType)
            {
                case CellType.Blank: //BLANK:
                    return null;
                case CellType.Boolean: //BOOLEAN:
                    return cell.BooleanCellValue;
                case CellType.Numeric: //NUMERIC:
                    return cell.NumericCellValue;
                case CellType.String: //STRING:
                    return cell.StringCellValue;
                case CellType.Error: //ERROR:
                    return cell.ErrorCellValue;
                case CellType.Formula: //FORMULA:
                    switch (cell.CachedFormulaResultType)
                    {
                        case CellType.Blank: //BLANK:
                            return null;
                        case CellType.Boolean: //BOOLEAN:
                            return cell.BooleanCellValue;
                        case CellType.Numeric: //NUMERIC:
                            return cell.NumericCellValue;
                        case CellType.String: //STRING:
                            return cell.StringCellValue;
                        case CellType.Error: //ERROR:
                            return cell.ErrorCellValue;
                        default: