views:

121

answers:

1

Hi i was wondering if there is away to allow tracing / diagnostics on a SQLConnection via the app.config file much like you can with WCF when you need tracing support (as below)?

<system.diagnostics>
   <switches>
      <add name="DataMessagesSwitch" value="0" />
      <add name="TraceLevelSwitch" value="0" />
   </switches>
</system.diagnostics>

I'm trying to intercept and log SQL requests from within my application (without needing to create an IDBConnection shim over a SQLConnection to capture the requests as they are executed)

Any thoughts?

+1  A: 

Does ADO.NET Technical Articles : Tracing Data Access help?

Preet Sangha
Hi, i checked that article, it requires quite a bit of dicking around, doing registry entries ect, using WMI, setting up filters to make sure you only trace your single application. I was hoping there was something like the previously mentioned WCF option that could be turned on in the configuration files, apparrently not!
mrwayne