为什么我的 OLE 数据源数据查询不一致?

发布于 2024-08-09 15:31:03 字数 340 浏览 4 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文