更改Excel文件2007中的列值类型 [英] change the column value type in excel file 2007

查看:91
本文介绍了更改Excel文件2007中的列值类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个Excel工作表,其中前几行是整数数据类型,其余的是文本数据类型.当我阅读此excel并将其转换为Datatable时,我得到了整数值,但Text Value为Empty.这也发生了Versa恶习.
我正在使用ASp.net 3.5和Office2007.

Hi

I have a excel sheet where the first few rows are interger data type & remaining are Text Datatype. When i read this excel and convert to Datatable i get the integer values but the Text Value Empty . This Happens Vice Versa also .
Am using ASp.net 3.5 & Office 2007.

推荐答案

这可能是由于该列包含文本和数字的混合数据,请参见错误值文档 [
This is probably caused by the fact that the column contain mixed data, both text and numbers, see the mising values of this documentation[^].

If you use "IMEX=1" in your connection string the mixed columns will be treated as string columns and you can converted them as needed.


这篇关于更改Excel文件2007中的列值类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆