I have this error when run this code:
string sql = "select * from customer_profile where profile_id = :1";
OracleCommand oraCursorCommand = new OracleCommand(sql, conn);
oraCursorCommand.CommandType = CommandType.Text;
oraCursorCommand.Parameters.Add("p1", OracleDbType.Long).Value = 68;
Why? I do not have this error while using ODP.Net!
ORA-01036 illegal variable name/number in 5.25.39.0
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Please try adding the parameter as follows:
In dotConnect for Oracle, the names of the OracleParameter instances added to the command should correspond to the parameter names used in the query. Please see the "Using Parameters" topic of our help:
http://www.devart.com/dotconnect/oracle ... eters.html
Code: Select all
oraCursorCommand.Parameters.Add("1", OracleDbType.Long).Value = 68;
http://www.devart.com/dotconnect/oracle ... eters.html