ORA-01036- The Comprehensive Guide for Frustrated ASP.Net People

If you’re running into the ambiguous, unhelpful “ORA-01036: illegal variable name/number” error when trying to do an update or an insert in ASP.Net while using a SqlDataSource, here’s some advice that may prevent you from pulling out all of your hair, swearing off technology forever, moving to rural Wyoming and living off the land until the end of your days…

  • Make sure you have the ProviderName specified in your SqlDataSource tag.  It should be System.Data.OracleClient (unless you’re using the Oracle.Whatever.Whatever provider)
  • Make sure you’re using :MyParameterName instead of @MyParameterName.
  • Get rid of OldValuesParameterFormatString in your SqlDataSource tag.
  • Each and every input where you have specified Bind(“FIELD_NAME”) MUST be represented in your UpdateParameters (and/or InsertParameters).  To debug this problem, what I recommend is that you change ALL of your Bind()s to Eval()s and pare down your SQL statements and update/insert parameters to just one or two things…then change the Evals to Binds as you add parameters to your SQL statement.  Every time you get a successful update/insert, add another parameter or two until you’ve found the problem.  More than likely you’ve got an extra input lurking somewhere that isn’t represented in your SQL query and/or parameters.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: