I'm doing something like
...
OracleCommand oCommand = new OracleCommand();
oConnection.Open();
oCommand.Connection = oConnection;
oCommand.CommandText = "SELECT * FROM employees WHERE user = :User";
oCommand.Parameters.AddWithValue(":Name", "Employee1");
DbDataReader dbRdr = oCommand.ExecuteReader();
then this throws an exception:
ORA-01745: invalid host/bind variable name
EDIT: connection string looks like this:
"Data Source=orcl;Persist Security Info=True;User ID=user_id;Password=pwd;Unicode=True"
No error after the oConnection.Open();
so I assume my connection string is correct.
On which part did I make a mistake?
ORA-01745: invalid host/bind variable name
Cause: A colon in a bind variable or INTO specification was followed by an inappropriate name, perhaps a reserved word.
Action: Change the variable name and retry the operation.
from here
To check what are reserved words, click here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With