错误[07001] [Oracle] [ODBC] [Ora] ORA-01008:并非所有变量都绑定 [英] ERROR [07001] [Oracle][ODBC][Ora]ORA-01008: not all variables bound
问题描述
每次运行此代码时,我都会从oracle中收到此错误错误[07001] [Oracle] [ODBC] [Ora] ORA-01008:并非所有变量都绑定。我可以得到一些帮助吗
这是我的代码如下
函数addrecord()As Boolean
Dim db As New医院'通过声明连接实例建立连接
Dim cmd As New OdbcCommand
cmd.Connection = db.connection
cmd.CommandText ="插入STAFFS值(?,?)" '告诉编译器你将在运行时传递表项的参数
cmd.CommandType = CommandType.Text
cmd.Parameters.AddWithValue("",username)告诉编译器?
cmd.Parameters.AddWithValue("",password)的值
返回cmd.ExecuteNonQuery()> 0'执行代码
结束函数
Each time I run this code I get this error from oracle "ERROR [07001] [Oracle][ODBC][Ora]ORA-01008: not all variables bound". Can I get some help please
This is my code below
Function addrecord() As Boolean
Dim db As New hospital 'establishing a connection by declaring an instance of the connection
Dim cmd As New OdbcCommand
cmd.Connection = db.connection
cmd.CommandText = "insert into STAFFS values (?,?)" 'telling the compiler you will pass parameters of the table item at runtime
cmd.CommandType = CommandType.Text
cmd.Parameters.AddWithValue("", username) 'telling the complier the values of the ?
cmd.Parameters.AddWithValue("", password)
Return cmd.ExecuteNonQuery() > 0 'executing the code
End Function
推荐答案
这里有一个完整细节的解决方案
ASP.NET ODBC Oracle错误ORA-01008:并非所有变量绑定已解决 [ ^ ]
附加链接 http://ora-01008.ora-code.com/ [ ^ ]
Here a solution with complete details
ASP.NET ODBC Oracle error "ORA-01008: not all variables bound" solved[^]
Additional link http://ora-01008.ora-code.com/[^]
这篇关于错误[07001] [Oracle] [ODBC] [Ora] ORA-01008:并非所有变量都绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!