title: viewing exact sql after parameter substitution C#
body: <p>Is there a way to access the CommandText just after it gets executed?
  I have the following code:</p>
  
  <pre><code>cmd = new OracleCommand(sql.ToString(), conn);
  cmd.Parameters.Add(new OracleParameter("@parm", parmValue));
  
  
  OracleDataAdapter da = new OracleDataAdapter(cmd);
  DataTable dt = new DataTable();
  da.Fill(dt);
  </code></pre>
  
  <p>What I need to know is the sql command string executed in the database that already has parmValue's value contained in the sql. In other words, I must not be able to see the string "@parm" inside the query but the value of it instead.</p>
  
  <p>I need this so that I could push this sql in a log database for future reference.</p>
  
  <p>Thanks in advance.</p>