from where the exception is handled because it throw the exception?

Dec 5, 2008 at 6:01 PM
In the data acces application block, in the following code: I want to know  from where the exception is handled  if there is a exception  it throw the exception.


Thanks.


protected

int DoExecuteNonQuery(DbCommand command)

 

{

 

try

 

{

 

DateTime startTime = DateTime.Now;

 

 

int rowsAffected = command.ExecuteNonQuery();

 

instrumentationProvider.FireCommandExecutedEvent(startTime);

 

return rowsAffected;

 

}

 

catch (Exception e)

 

{

instrumentationProvider.FireCommandFailedEvent(command.CommandText, ConnectionStringNoCredentials, e);

 

throw;

 

}

}

Dec 6, 2008 at 3:38 AM
You would need to handle that exception yourself when you call the ExecuteNonQuery method of a Database object so you would know what was the exact error that occured.


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