Oracle datetime in VB.net(VB.net 中的 Oracle 日期时间)
本文介绍了VB.net 中的 Oracle 日期时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 Oracle 过程,我必须向它传递一个日期时间值 (2/5/2010 11:46 AM)我如何从 VB.net 传递这个值.当我传递如下所示的日期时,虽然有记录,但它没有返回任何记录.
I have a Oracle procedure to which I have to pass a datetime value (2/5/2010 11:46 AM) How do I pass this value from VB.net. When I pass the date as shown below it is not returning any records though there are records.
With Cmd
.Connection = FactsConn
.CommandType = CommandType.StoredProcedure
.CommandText = "sp_atas_image_qry"
.Parameters.Add(New OracleParameter("vinspectiondatetime", OracleClient.OracleType.DateTime)).Value = "2/5/2010 11:46 AM"
.Parameters.Add(New OracleParameter("io_cursor", OracleClient.OracleType.Cursor)).Direction = ParameterDirection.Output
End With
推荐答案
你可能应该发送一个 DateTime 对象,而不是一个 String:
You should probably send a DateTime object, not a String:
.Parameters.Add(New OracleParameter("vinspectiondatetime", OracleClient.OracleType.DateTime)).Value = new DateTime(2010, 2, 5, 11, 46, 0)
这篇关于VB.net 中的 Oracle 日期时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
沃梦达教程
本文标题为:VB.net 中的 Oracle 日期时间
猜你喜欢
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- SQL 临时表问题 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
