title: ExecuteScalar not functioning on server
body: <p>The application uses Oracle DataAccess ver. 1.1.  , VS 2008, .Net Framework 3.5 w/SP1</p>
  
  <pre><code>OracleConnection connection = new OracleConnection(ConnectionStringLogon);
  connection.Open();
  
  OracleParameter selectParam = new OracleParameter(":applicationName", OracleDbType.Varchar2, 256);
  selectParam.Value = applicationName;
  
  if (connection.State != ConnectionState.Open)
      connection.Open();
  
  OracleCommand cmd = new OracleCommand();
  
  cmd.Connection = connection;
  cmd.CommandText = "Select ApplicationId from Applications where AppName = 'appName'";
  cmd.CommandType = CommandType.Text;
  
  if (selectParam != null)
  {
          cmd.Parameters.Add(selectParam);
  }
  object lookupResult = cmd.ExecuteScalar();
  cmd.Parameters.Clear();
  
  if (lookupResult != null)
  </code></pre>
  
  <p>The procedure fails on object lookupResult = cmd.ExecuteScalar(); with this error:</p>
  
  <p>Event Type: Error
  Event Source:   App Log
  Event Category: None
  Event ID:   9961
  Date:       9/30/2008
  Time:       4:42:11 PM
  User:       N/A
  Computer:   Server15
  Description:
  System.NullReferenceException: Object reference not set to an instance of an object.
     at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
     at Oracle.DataAccess.Client.OracleCommand.ExecuteReader()
     at Oracle.DataAccess.Client.OracleCommand.ExecuteScalar()
     at Membership.OracleMembershipProvider.GetApplicationId(String applicationName, Boolean createIfNeeded) in OracleMembershipProvider.cs:line 1626</p>
  
  <p>I've looked at this from every angle that I can conceive of...  basically, no matter how I wrap it, the Execute fails.</p>