public byte[] Execute(ActionEvent actionEvent, ActionContext context) { try { using (var destinationConnection = new SqlConnection(ConnectionString)) { destinationConnection.Open(); using (var bulkCopy = new SqlBulkCopy(ConnectionString)) { bulkCopy.DestinationTableName = TableNameDestination; try { object obj = Serialization.ByteArrayToDataTable(DataContext); var dataTable = (DataTable)obj; // Write from the source to the destination. bulkCopy.WriteToServer(dataTable); } catch (Exception) { // ignored } } } actionEvent(this, context); return(null); } catch { // ignored return(null); } }
public void Execute(SetEventActionEvent setEventActionEvent, EventActionContext context) { try { using (var destinationConnection = new SqlConnection(this.ConnectionString)) { destinationConnection.Open(); using (var bulkCopy = new SqlBulkCopy(this.ConnectionString)) { bulkCopy.DestinationTableName = this.TableNameDestination; try { object obj = Serialization.ByteArrayToDataTable(this.DataContext); var dataTable = (DataTable)obj; // Write from the source to the destination. bulkCopy.WriteToServer(dataTable); } catch (Exception) { // ignored } } } setEventActionEvent(this, context); } catch { // ignored } }