ORA-01036 illegal variable name/number in

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Posts: 5
Joined: Thu 28 Jan 2010 07:03

ORA-01036 illegal variable name/number in

Post by quangnd » Thu 28 Jan 2010 07:08

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!

Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Thu 28 Jan 2010 12:24

Please try adding the parameter as follows:

Code: Select all

oraCursorCommand.Parameters.Add("1", OracleDbType.Long).Value = 68;
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

Post Reply