title: ORA-01036: illegal variable name/number
body: <p>I retrieve data from Oracle database and populate a gridview. Next, I try to run a query to select some data but I get an error. 
  Here is the code:</p>
  
  <p>Db.cs:</p>
  
  <pre><code>public static OracleConnection GetConnection()
  {
      OracleConnection connection = null;
  
      string connectionString = "Data Source=" + Database +
          ";User ID=" + UserID +
          ";Password=" + Password +
          ";Unicode=True";
  
      try
      {
          connection = new OracleConnection(connectionString);
      }
      catch (OracleException ex)
      {
          throw ex;
      }
  
      return connection;
  }
  </code></pre>
  
  <p>Parameters are sent from default.aspx.cs:</p>
  
  <pre><code>new Db(database, userID, password);
  OracleConnection connection = Db.GetConnection();
  </code></pre>
  
  <p>main.aspx.cs retrieves all the data:</p>
  
  <pre><code>private OracleConnection connection = new OracleConnection();
  private Select select = new Select();
  
  protected void Page_Load(object sender, EventArgs e)
  {
      Response.Buffer = true;
  
      if (Db.IsLoggedIn())
      {
          string selectCommand = 
             "SELECT " + Settings.TABLE + ".* FROM " + Settings.TABLE + " ORDER BY ";
          foreach (string ob in Settings.OB) selectCommand += ob + ", ";
  
          Session["Error"] = null;
          connection = Db.GetConnection();
  
          select = new Select(ddlBubID, ddlBusArea, ddlDrillSite, ddlWell, connection);
  
          gvData.DataKeyNames = Settings.PK;
          gvData.SelectedIndex = -1;
  
          DS.ConnectionString = connection.ConnectionString;
          DS.SelectCommand = selectCommand.Remove(selectCommand.Length - 2, 2);
          DS.ProviderName = Settings.PROVIDER_NAME;
  
          PopulateFooter(gvData.FooterRow);
      }
      else
      {
          Session["Error"] = Settings.ERROR_MESSAGE[0, 0];
          Response.Clear();
          Response.Redirect("default.aspx");
      }
  }
  
  public string ToolTip(string column)
  {
      string value = "";
      OracleCommand cmd = new OracleCommand();
      cmd.Connection = connection;
      cmd.CommandText = "SELECT DISTINCT COMMENTS " +
                        "FROM SYS.ALL_COL_COMMENTS " +
                        "WHERE (TABLE_NAME = 'CTD_PROBLEM_EDIT_V') " +
                        "AND (COLUMN_NAME = " + column + ")";
      cmd.CommandType = CommandType.Text;
      OracleDataReader reader = cmd.ExecuteReader(); // I get an error here
      reader.Read();
          value = reader["COMMENTS"].ToString();
      reader.Close();
      return value;
  }
  
  protected void gvData_RowDataBound(object sender, GridViewRowEventArgs e)
  {
      if (e.Row.RowType == DataControlRowType.DataRow)
          for (int i = 1; i &lt; e.Row.Cells.Count; i++)
          {
              try
              {
                  LinkButton lb =
                      (LinkButton)gvData.HeaderRow.Cells[i].Controls[0];
                  lb.ToolTip = ToolTip(lb.Text);
  
                  /* Blah Blah*/
              }
              catch { }
  
          }
  
      if (e.Row.RowType == DataControlRowType.Footer)
          PopulateFooter(e.Row);
  }
  </code></pre>
  
  <p>ToolTip(); throws an error:
  Invalid operation. The connection is closed.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>This would have been helpful: 
    <a href="http://msdn.microsoft.com/en-us/library/79b3xss3%28v=vs.80%29.aspx" rel="nofollow">Static Classes and Static Class Members</a></p>