public DbBulkCopierX(Common.ConnectionType connectionType, string connectionString, string tableName, params string[] columnNames) { ConnectionType = connectionType; ConnectionString = connectionString; TableName = tableName; ColumnNames = columnNames; }
public static BulkCopy GetBulkCopy(Common.ConnectionType connectionType, string connectionString) { switch (connectionType) { case Common.ConnectionType.SqlServer: return(new SqlBulkCopy(connectionString)); case Common.ConnectionType.Oracle: return(new OracleBulkCopy(connectionString)); default: throw new ArgumentException("Unsupported ConnectionType: " + connectionType); } }
public DataHandler(Common.ConnectionType connctionType) { string connection = string.Empty; if (connctionType == Common.ConnectionType.Ascend) { connection = ConfigurationManager.ConnectionStrings["Ascend"].ConnectionString; objConnection = new SqlConnection(connection); } else { connection = ConfigurationManager.ConnectionStrings["MarineDelivery"].ConnectionString; objConnection = new SqlConnection(connection); } }