Is there a way to access the full SQL query, including the values, inside my code?
I am able to log SQL queries using log4net:
Use a log4net appender with specific target (afair it supports being toggled on/off) or just extend it and toggle it within your try-catch-finally-off.