Troubleshooting the "ORA-01036: illegal variable name/number" Error When Calling an Oracle Stored Procedure from .NET
Yesterday I had written some code in C# to call a stored procedure in an Oracle database, and when I began testing this code today, I was surprised to get the following error whenever the code would attempt to execute the OracleCommand: ORA-01036: illegal variable name/number I was scratching my head. Why wasn't this working? I've done this before! From previous experience, I knew that the names of the procedure parameters must match exactly when you add them to the OracleCommand object . In other words, if your stored procedure is expecting two parameters, named email and phonenumber , your code should look something like this: cmd.Parameters.Add("email", OracleType.VarChar); cmd.Parameters.Add("phonenumber", OracleType.VarChar); cmd.Parameters["email"].Value = psEmail; cmd.Parameters["phonenumber"].Value = psPhone; I checked the parameter names and I was already using the correct ones. What else was I missing? Then it dawned on me