public DataTransferResult RunDataTransfer(Hashtable sqlParams) { var swatch = Stopwatch.StartNew(); DataTransferResult status = new DataTransferResult(this); try { PSIS.SSRuntime.SubmitChangesInBulk(_source,_type, DestConnectionString, DestinationTable, SqlBulkCopyOptions.Default, DestTimeout); } catch (Exception ex) { status.Error = ex; } status.Elapsed = swatch.Elapsed; return status; }
public DataTransferResult RunDataTransfer(Hashtable sqlParams) { var swatch = Stopwatch.StartNew(); DataTransferResult status = new DataTransferResult(this); try { using (IDbConnection srcConn = CreateConnection()) using (IDbCommand srcCmd = CreateSourceCommand(srcConn, SqlQuery, sqlParams)) { srcConn.Open(); status.RowCount = PSIS.SSRuntime.SubmitChangesInBulk(srcCmd.ExecuteReader(), DestConnectionString, DestinationTable, SqlBulkCopyOptions.Default, DestTimeout); } } catch (Exception ex) { status.Error = ex; } status.Elapsed = swatch.Elapsed; return status; }