使用 Oracle.DataAcess 时应该发送什么日期格式

发布于 2024-08-30 11:16:00 字数 356 浏览 3 评论 0原文

从使用 Microsoft Syste.Data.OracleClient 转换为我认为所谓的 Oracle ODT (Oracle.DataAccess 10.2.0.100)。当我尝试发送日期时,出现此错误“ORA-1858:在需要数字的地方发现非数字字符”。这段代码使用 System.Data.OracleClient 效果很好。

cmd.Parameters.Add(New OracleParameter("I_FIRST_LOSS_EVENT_DATE", OracleDbType.Date)).Value = .LossEventsMessages(0).LossEventTime

谢谢,

戴夫

Converting from usind Micorsofts Syste.Data.OracleClient to what I believe is called Oracles ODT (Oracle.DataAccess 10.2.0.100). When I try and send a date I get this error "ORA-1858: a non-numeric character was found where a numeric was expected". This code worked great using System.Data.OracleClient.

cmd.Parameters.Add(New OracleParameter("I_FIRST_LOSS_EVENT_DATE", OracleDbType.Date)).Value = .LossEventsMessages(0).LossEventTime

Thanks,

Dave

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

二货你真萌 2024-09-06 11:16:00

As per Table 3-10 in the Oracle Data Provider for .NET Developer's Guide, the data type of the Value property of the parameter should be System.DateTime (unless you're willing to use an ODP.NET-specific type, in which case it should be OracleDate or one of the OracleTimeStamp types, depending on your column/parameter type).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文