开发者

Oracle error ORA-01008 inside VB.NET code

Why am I getting this Oracle error when executing this VB.NET code?

Ora-01008: all variables not bound

Dim szSQLEvt As String = ""
Dim sbEvt As New StringBuilder
sbEvt.Append("INSERT INTO WORKORDERHISTORY (WORKORDERNUMBER, WORKORDEREVENT, EVENTDATE, USERNAME) ")
sbEvt.Append("VALUES(:EvtWorkOrderNumber, :WorkOrderEvent, :EventDate, :EvtUsername) ")
szSQLEvt = sbEvt.ToString
Dim cmdEvt As New OracleCommand
cmdEvt.BindByName = True
cmdEvt.Connection = conn
cmdEvt.CommandText = szSQLEvt
cmdEvt.Parameters.Add(":EvtWorkOrderNumber", Oracle.DataAccess.Client.OracleDbType.Varchar2开发者_高级运维)
cmdEvt.Parameters.Item(":EvtWorkOrderNumber").Value = szNewWONum
cmdEvt.Parameters.Add(":WorkOrderEvent", Oracle.DataAccess.Client.OracleDbType.Varchar2)
cmdEvt.Parameters.Item(":WorkOrderEvent").Value = "assigned"
cmd.Parameters.Add(":EventDate", Oracle.DataAccess.Client.OracleDbType.Date)
cmd.Parameters.Item(":EventDate").Value = Today
cmd.Parameters.Add(":EvtUsername", Oracle.DataAccess.Client.OracleDbType.Varchar2)
cmd.Parameters.Item(":EvtUsername").Value = szCurrUser
If conn.State <> ConnectionState.Open Then conn.Open()
cmdEvt.ExecuteNonQuery()
conn.Close()
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜