【发布时间】:2012-07-20 05:38:37
【问题描述】:
我在 vb.net.am 中使用 oracle 命令中的 select 语句编写代码。当我通过变量传递参数值时出现错误。
my code
------
chk1 = TextBox1.Text
d1 = Date.Parse(chk1)
--------
--------
try
cn.Open()
cmd = New OracleCommand("select PHONE from reports.renewal_contact_t where run_date=to_date('+ d1 +','mm/dd/yyyy') and EXP_DATE =to_date('07/21/2012','mm/dd/yyyy')", cn)
------------
ada.Fill(ds, "reports.renewal_contact_t ")
end try
eror(in ada.fill statement)
-----
ORA-01858: a non-numeric character was found where a numeric was expected
【问题讨论】:
-
那会是什么错误,请提供消息/堆栈跟踪。此外,从您的代码来看,您似乎没有为 d1 传递参数。
标签: oracle vb.net-2010 par