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
Post a Comment