Enterprise Library - persistence without stored procedures

Topics: Building and extending application blocks, Data Access Application Block, Enterprise Library Core, Logging Application Block
Sep 11, 2013 at 9:46 PM

I'm experiencing a problem, I wanted to make the persistence without using stored procedures with Enterprise Library, perhaps catch the LogEntry object before being persisted.

Anyone know how to do this or where I can find something?
Sep 12, 2013 at 6:32 AM
If you wish to log to a database without using the stored procedures provided with the FormattedDatabaseTraceListener then you will need to create a new Trace Listener that uses either Enterprise Library Data Access Application Block or ADO.NET (or any persistence method you care to use!).

You can either download the Enterprise Library Source code and use the FormattedDatabaseTraceListener code from there or you could download the Custom Database Trace Listener Sample and modify the code to suit your needs. Note that the custom sample uses a custom LogEntry and custom database schema so you would probably want to modify that as well.

Randy Levy
Enterprise Library support engineer
Support How-to