我有一个 Oracle 过程,我必须将一个日期时间值从我分配为 bdp1 的基本日期选择器传递给它。如何从 VB.net 传递这个值。当我通过日期时,它不会执行该功能
Public Function GetDate(ByVal strMaterial As String, ByVal ListBox1 As String, ByVal bdp1 As Date) As DataSet
Dim connectionString As String = "Data Source = ***; User ID = ***; Password = **;"
Dim sqlConnection As OracleClient.OracleConnection = New OracleClient.OracleConnection(connectionString)
Dim queryString As String = "select * from abc where tran_dttm <= to_date( ':bdp1','MM-DD-YYYY' ) and tran_dttm > to_date( ':bdp1','MM-DD-YYYY')"
Dim sqlCommand As OracleClient.OracleCommand = New OracleClient.OracleCommand(queryString, sqlConnection)
sqlCommand.CommandTimeout = 0
sqlCommand.Parameters.AddWithValue(":strMaterial", txtMaterial.Text)
sqlCommand.Parameters.AddWithValue(":ListBox1", ListBox1)
sqlCommand.Parameters.AddWithValue(":bdp1", bdp1)
Dim dataAdapter As OracleClient.OracleDataAdapter = New OracleClient.OracleDataAdapter(sqlCommand)
Dim dataSet As DataSet = New DataSet
dataAdapter.Fill(dataSet)
Return dataSet
End Function