我有一个 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 日期时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
我应该使用什么 SQL Server 数据类型来存储字节 What SQL Server Datatype Should I Use To Store A Byte[](我应该使用什么 SQL Server 数据类型来存储字节 [])
解释 SQL Server 中 sys.objects 中的类型代码Interpreting type codes in sys.objects in SQL Server(解释 SQL Server 中 sys.objects 中的类型代码)
Typeorm .loadRelationCountAndMap 返回零Typeorm .loadRelationCountAndMap returns zeros(Typeorm .loadRelationCountAndMap 返回零)
如何将“2016-07-01 01:12:22 PM"转换为“2016-07-0How to convert #39;2016-07-01 01:12:22 PM#39; to #39;2016-07-01 13:12:22#39; hour format?(如何将“2016-07-01 01:12:22 PM转换为“2016-07-01 13:1
将多个子查询转换为 on joinConvert multiple sub-queries to on join(将多个子查询转换为 on join)
如何获得 T SQL 中 2 次之间的微小差异?How do I get the minute difference between 2 times in T SQL?(如何获得 T SQL 中 2 次之间的微小差异?)