开发者

What Date Format Should I Send When Using Oracle.DataAcess

开发者 https://www.devze.com 2022-12-28 04:01 出处:网络
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 ch

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 cha开发者_开发知识库racter 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


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消