为什么我的 OLE 数据源数据查询不一致?
我有一个 Microsoft Excel 2003 文件,正在使用 OleDbConnection 从 C# 2.0 查询该文件。
Excel 文件中的单元格之一被格式化为短日期,并在 Excel 中显示为“1/1/2009”。如果我将格式更改为常规,则该单元格中显示的文本将更改为“39814”。
如果我在文件打开时查询 Excel 文件,我会在结果集中收到“39814”。
如果我在文件关闭时查询 Excel 文件,我会在结果集中收到“1/1/2009”。
为什么从此 Ole 数据源导入数据不一致?
谢谢你,
基思
I have a Microsoft Excel 2003 file that I am querying from C# 2.0 using an OleDbConnection.
One of the cells in the Excel file is formated as a short date and displays in Excel as "1/1/2009". If I change the format to General the text displayed in that cell changes to "39814".
If I query the Excel file while the file is open, I receive "39814" in the result set.
If I query the Excel file while the file is closed, I receive "1/1/2009" in the result set.
Why the inconsistency with importing data from this Ole Data Source?
Thank you,
Keith
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论