c# - How to add logger in the Azure Worker role? -


the below code used bulk insert data azure database. not work when hosted in azure instance.

try {   sqlcommand truncate = new sqlcommand("truncate table dbo.dispatch", connection);   truncate.transaction = transaction;   truncate.executenonquery();    using (var bulkcopy = new sqlbulkcopy(connection, sqlbulkcopyoptions.default, transaction))   {     bulkcopy.batchsize = 100;     bulkcopy.destinationtablename = "dbo.dispatch";     bulkcopy.writetoserver(dispatch.asdatatable());   }    sqlcommand updatehaulercode = new sqlcommand("exec [sp_updatedispatchhaulercodes]", connection);   updatehaulercode.transaction = transaction;   updatehaulercode.executenonquery();   transaction.commit();  } catch (exception) {   transaction.rollback(); } 

i want add logging in catch statement.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -