Log cannot write to database Message: Could not find stored procedure 'All Events'.

Topics: Logging Application Block
Aug 10, 2010 at 3:54 PM

When I try to configure the log block to write to SQL Server instance I get the following exception. The SQL server database is set up and does not have a stored procedure all events. There is a special category all events however and my guess is the code is mixing up the stored procedure and the category. Any ideas??

 

Exception Information Details:

======================================

Exception Type: System.Data.SqlClient.SqlException

Errors: System.Data.SqlClient.SqlErrorCollection

Class: 16

LineNumber: 1

Number: 2812

Procedure:

Server:######################

State: 62

Source: .Net SqlClient Data Provider

ErrorCode: -2146232060

Message: Could not find stored procedure 'All Events'.

Data: System.Collections.ListDictionaryInternal

TargetSite: Void OnError(System.Data.SqlClient.SqlException, Boolean)

HelpLink: NULL

StackTrace Information Details:

======================================

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()

at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)

at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)

at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteNonQuery(DbCommand command) in e:\Builds\EntLib\Latest\Source\Blocks\Data\Src\Data\Database.cs:line 443

at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery(DbCommand command, DbTransaction transaction) in e:\Builds\EntLib\Latest\Source\Blocks\Data\Src\Data\Database.cs:line 732

at Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener.ExecuteAddCategoryStoredProcedure(LogEntry logEntry, Int32 logID, Database db, DbTransaction transaction) in e:\Builds\EntLib\Latest\Source\Blocks\Logging\Src\DatabaseTraceListener\FormattedDatabaseTraceListener.cs:line 263

at Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener.ExecuteStoredProcedure(LogEntry logEntry) in e:\Builds\EntLib\Latest\Source\Blocks\Logging\Src\DatabaseTraceListener\FormattedDatabaseTraceListener.cs:line 156

at Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener.TraceData(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, Object data) in e:\Builds\EntLib\Latest\Source\Blocks\Logging\Src\DatabaseTraceListener\FormattedDatabaseTraceListener.cs:line 89

at Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.TraceListenerWrapper.TraceData(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, Object data) in e:\Builds\EntLib\Latest\Source\Blocks\Logging\Src\Logging\TraceListeners\TraceListenerWrapper.cs:line 92

at Microsoft.Practices.EnterpriseLibrary.Logging.LogSource.TraceData(TraceEventType eventType, Int32 id, LogEntry logEntry, TraceListenerFilter traceListenerFilter, TraceEventCache traceEventCache) in e:\Builds\EntLib\Latest\Source\Blocks\Logging\Src\Logging\LogSource.cs:line 180

at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterImpl.ProcessLog(LogEntry log, TraceEventCache traceEventCache) in e:\Builds\EntLib\Latest\Source\Blocks\Logging\Src\Logging\LogWriterImpl.cs:line 557

 

Aug 10, 2010 at 4:00 PM

Somehow I update the Add Category Procedure to All Events by accident.

 

The dude abides.

Aug 11, 2010 at 12:52 AM

Is your problem already solved?  Have you changed the Add Category Procedure property to AddCategory?

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com