title: Using OracleCommand with a column alias
body: <p>I am attempting to write an oracle query that the client has requested a specific column name for the output.  Simple enough, I write the query using an <a href="https://stackoverflow.com/questions/56591/double-quotes-in-oracle-column-aliases">oracle column alias</a> using double quotes.  (Note that I am using the quotes because it just so happens that the requested column name is a reserved word.)<br>
  The issue is that I am receiving the from the error <code>ORA-00911: invalid character</code> when I attempt to execute the query using the following code:</p>
  
  <pre><code>OracleCommand command = new OracleCommand(sqlquery, connection.Conn);
  dt.Load(command.ExecuteReader());
  </code></pre>
  
  <p>I have tried the <a href="http://www.memosoup.com/20110111/oracle-quote-and-quote-operator.html" rel="nofollow noreferrer">oracle quote operator</a> and the various iterations of the <a href="https://stackoverflow.com/questions/1928909/in-c-can-i-escape-a-double-quote-in-a-literal-string">c# string literal</a> (i.e. @"this is ""testing"" the literal" and "this is \"testing\" the literal").</p>
  
  <p>The query is simple in that I would like to do this:</p>
  
  <pre><code>select column1 as "alias1" from dual;
  </code></pre>
  
  <p>This works when I run it directly in Oracle but I am unable to get it to run via the .Net application.  Having escaped the double quotes and viewing the query in the debugger shows that it has been formatted as:</p>
  
  <pre><code>select column1 as \"alias1\" from dual;
  </code></pre>
  
  <p>It seems ¿obvious? that the backslashes are causing the Oracle error but how do I get around this?</p>