Exceptions - write to database. Not happening.

Topics: Data Access Application Block, Exception Handling Application Block, Logging Application Block
May 14, 2008 at 11:14 AM
Edited May 14, 2008 at 2:22 PM
Greetings people

I am trying to get the Exception Handling App Block to log the exception to the database (using the DAAB and LAB). I have got the LAB and EHAP writing to a flat file, the Event Viewer and sending Email - but I cannot get it to log to DB.

I do have the tables and stored procs set up. And I have checked the connection string is correct.
I also have references to:
  • Microsoft.Practices.EnterpriseLibrary.Logging.Database
  • Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
  • Microsoft.Practices.EnterpriseLibrary.Logging
  • Microsoft.Practices.EnterpriseLibrary.Logging.Database
  • Microsoft.Practices.EnterpriseLibrary.Data;
  • Microsoft.Practices.EnterpriseLibrary.Data.Sql;

I am not getting any errors.

What could I possibly be doing wrong?

Thanks for any help.
May 15, 2008 at 8:50 AM


MagickDK wrote:
Greetings people

I am trying to get the Exception Handling App Block to log the exception to the database (using the DAAB and LAB). I have got the LAB and EHAP writing to a flat file, the Event Viewer and sending Email - but I cannot get it to log to DB.

I do have the tables and stored procs set up. And I have checked the connection string is correct.
I also have references to:
  • Microsoft.Practices.EnterpriseLibrary.Logging.Database
  • Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
  • Microsoft.Practices.EnterpriseLibrary.Logging
  • Microsoft.Practices.EnterpriseLibrary.Logging.Database
  • Microsoft.Practices.EnterpriseLibrary.Data;
  • Microsoft.Practices.EnterpriseLibrary.Data.Sql;

I am not getting any errors.

What could I possibly be doing wrong?

Thanks for any help.


OK I think I may have found the problem. I was first using SQL Server Express, and I was getting the following error:

Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance

Then I  tried with SQL Server and now I get this error:
An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Shared Memory Provider, error: 40 - Could not open a connection to SQL Server)

Has anyone managed to get Exception logging working with either MySQL or preferably Postgresql?
May 15, 2008 at 11:07 AM
OK found the problem.

The EntLib config tool wasnt writing the connection string to the web.config file.

I deleted the DAAB and re-entered it and its working now.