예제 #1
0
파일: Import.cs 프로젝트: gerakul/FastSql
        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);
                }
            }
        }
예제 #2
0
파일: Import.cs 프로젝트: gerakul/FastSql
        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);
                }
            }
        }