views:

23

answers:

1

I'm using Microsoft.Practices.EnterpriseLibrary.Data.Database to create my accessors and execute my queries.

I'd like to know if there is anyway, within this scenario, to automatically log all queries and parameters that are being sent to the database.

A: 

There's nothing built into Entlib that does this. However, you can get the same information from the database side using Sql Profiler, if you're using Sql Server anyway. I expect that other databases have similar tools, but I don't know enough about them.

Accessors don't actually generate sql anyway, they just run the sql (or stored proc) that you hand to them, so there's not a whole lot to log.

Chris Tavares