C# 클래스 CoreTechs.Common.Database.SqlDataTransfer

Provides the ability to bulk insert data from a source table (or query) into a destination table. SQL Server only.
파일 보기 프로젝트 열기: Core-Techs/Common

공개 메소드들

메소드 설명
SqlDataTransfer ( string sourceConnectionString, string destinationConnectionString ) : System
TransferData ( string tableName, string query = null, SqlParameter queryParams = null, SqlBulkCopyOptions sqlBulkCopyOptions = SqlBulkCopyOptions.Default, SqlTransaction sqlTransaction = null, Action sqlBulkCopyCustomizer = null, bool smartColumnMapping = true ) : void

Transfer data into a destination table.

비공개 메소드들

메소드 설명
MapColumns ( DataTable sourceSchema, System.Data.SqlClient.SqlBulkCopy bcp, SqlConnection dest ) : void

메소드 상세

SqlDataTransfer() 공개 메소드

public SqlDataTransfer ( string sourceConnectionString, string destinationConnectionString ) : System
sourceConnectionString string
destinationConnectionString string
리턴 System

TransferData() 공개 메소드

Transfer data into a destination table.
public TransferData ( string tableName, string query = null, SqlParameter queryParams = null, SqlBulkCopyOptions sqlBulkCopyOptions = SqlBulkCopyOptions.Default, SqlTransaction sqlTransaction = null, Action sqlBulkCopyCustomizer = null, bool smartColumnMapping = true ) : void
tableName string /// The name of the table that will be written to. /// If a query is not provided this will also be the name of the table that data is read from.
query string An optional query that will be used as the source of data.
queryParams System.Data.SqlClient.SqlParameter Optional parameters that are used by the source data query.
sqlBulkCopyOptions SqlBulkCopyOptions Options used by .
sqlTransaction System.Data.SqlClient.SqlTransaction Optional object that will be used to construct the .
sqlBulkCopyCustomizer Action Optional delegate that can customize the object.
smartColumnMapping bool /// Passing true will cause source columns to be mapped to destination columns by name and computed columns to be ignored. /// A value of false will result in ordinal based mapping of all columns. Defaults to true. ///
리턴 void