public static async Task ExecuteAsync(CancellationToken cancellationToken, ImportOptions options, string connectionStringFrom, string connectionStringTo, string commandText, string destinationTable, params object[] commandParameters) { using (SqlConnection connFrom = new SqlConnection(connectionStringFrom)) { await connFrom.OpenAsync().ConfigureAwait(false); using (SqlConnection connTo = new SqlConnection(connectionStringTo)) { await connTo.OpenAsync().ConfigureAwait(false); Import import = new Import(connFrom, connTo); await import.ExecuteAsync(cancellationToken, options, commandText, destinationTable, commandParameters).ConfigureAwait(false); } } }
public static void Execute(ImportOptions options, string connectionStringFrom, string connectionStringTo, string commandText, string destinationTable, params object[] commandParameters) { using (SqlConnection connFrom = new SqlConnection(connectionStringFrom)) { connFrom.Open(); using (SqlConnection connTo = new SqlConnection(connectionStringTo)) { connTo.Open(); Import import = new Import(connFrom, connTo); import.Execute(options, commandText, destinationTable, commandParameters); } } }