Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 29-Aug-13 12:53pm
v2
Comments
[no name] 29-Aug-13 20:14pm    
http://www.devart.com/dotconnect/oracle/articles/parameters.html

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900