/// <summary> /// Add a flat file source and oledb destination package in project /// </summary> /// <param name="srcfile">source flat file</param> /// <param name="destserver">destination server name</param> /// <param name="destdb">destination database name</param> /// <param name="desttable">destination table name</param> /// <returns>package stream name</returns> public string AddFlatFileToOleDbPackage <TransformType>(string srcfile, string destserver, string destdb, string desttable) { Debug.Assert(!string.IsNullOrEmpty(srcfile), @"The source file could not be nullable."); Debug.Assert(!string.IsNullOrEmpty(destserver), @"The destination server could not be nullable."); Debug.Assert(!string.IsNullOrEmpty(destdb), @"The destination database could not be nullable."); Debug.Assert(!string.IsNullOrEmpty(desttable), @"The destination table could not be nullable."); EzSrcDestPackage <EzFlatFileSource, EzFlatFileCM, EzOleDbDestination, EzSqlOleDbCM> package = new EzSrcDestPackage <EzFlatFileSource, EzFlatFileCM, EzOleDbDestination, EzSqlOleDbCM>(); package.SrcConn.ConnectionString = srcfile; package.DestConn.SetConnectionString(destserver, destdb); package.Dest.Table = desttable; return(AddPackage(package)); }
/// <summary> /// Add an Oledb Source and destiantion package in project /// </summary> /// <typeparam name="TransformType">Transform Component Type</typeparam> /// <param name="srcserver">source server name</param> /// <param name="srcdb">source database name</param> /// <param name="srcsql">source sql command statment</param> /// <param name="destserver">destination server name</param> /// <param name="destdb">destination database name</param> /// <param name="desttable">destination table name</param> /// <returns>package stream name</returns> public string AddOleDbPackage(string srcserver, string srcdb, string srcsql, string destserver, string destdb, string desttable) { Debug.Assert(!string.IsNullOrEmpty(srcserver), @"The source server could not be nullable."); Debug.Assert(!string.IsNullOrEmpty(srcdb), @"The source database could not be nullable."); Debug.Assert(!string.IsNullOrEmpty(srcsql), @"The source sql command statement could not be nullable."); Debug.Assert(!string.IsNullOrEmpty(destserver), @"The destination server could not be nullable."); Debug.Assert(!string.IsNullOrEmpty(destdb), @"The destination database could not be nullable."); Debug.Assert(!string.IsNullOrEmpty(desttable), @"The destination table could not be nullable."); //construct a transform package EzSrcDestPackage <EzOleDbSource, EzSqlOleDbCM, EzOleDbDestination, EzSqlOleDbCM> package = new EzSrcDestPackage <EzOleDbSource, EzSqlOleDbCM, EzOleDbDestination, EzSqlOleDbCM>(); package.SrcConn.SetConnectionString(srcserver, srcdb); package.Source.SqlCommand = srcsql; package.DestConn.SetConnectionString(destserver, destdb); package.Dest.Table = desttable; //add this package in project return(AddPackage(package)); }
/// <summary> /// Add an oledb source and flat file destination package in project /// </summary> /// <param name="srcserver">source server name</param> /// <param name="srcdb">source database name</param> /// <param name="srcsql">source sql command statment</param> /// <param name="file">destination flat file</param> /// <returns>package stream name</returns> public string AddOleDbToFilePackage(string srcserver, string srcdb, string srcsql, string destfile) { Debug.Assert(!string.IsNullOrEmpty(srcserver), @"The source server could not be nullable."); Debug.Assert(!string.IsNullOrEmpty(srcdb), @"The source database could not be nullable."); Debug.Assert(!string.IsNullOrEmpty(srcsql), @"The source sql command statement could not be nullable."); Debug.Assert(!string.IsNullOrEmpty(destfile), @"The destination file could not be nullable."); EzSrcDestPackage <EzOleDbSource, EzSqlOleDbCM, EzFlatFileDestination, EzFlatFileCM> package = new EzSrcDestPackage <EzOleDbSource, EzSqlOleDbCM, EzFlatFileDestination, EzFlatFileCM>(); package.SrcConn.SetConnectionString(srcserver, srcdb); package.Source.SqlCommand = srcsql; package.DestConn.ConnectionString = destfile; package.Dest.Overwrite = true; package.Dest.DefineColumnsInCM(); return(AddPackage(package)); }
/// <summary> /// Add an source destionation package in project /// </summary> /// <typeparam name="SourceType">Source Adapter Type</typeparam> /// <typeparam name="SourceConnectionType">Source Connection Manager Type</typeparam> /// <typeparam name="TranformType">Tranform Component Type</typeparam> /// <typeparam name="DestinationType">Destination Adapter Type</typeparam> /// <typeparam name="DestinationConnectionType">Destination Connection Manager Type</typeparam> /// <param name="source">source adapter</param> /// <param name="srcconn">source connection manager</param> /// <param name="destination">destination adapter</param> /// <param name="destconn">destination connection manager</param> /// <returns>package stream name</returns> public string AddPackage <SourceType, SourceConnectionType, DestinationType, DestinationConnectionType> (SourceType source, SourceConnectionType srcconn, DestinationType destination, DestinationConnectionType destconn) where SourceType : EzAdapter where SourceConnectionType : EzConnectionManager where DestinationType : EzAdapter where DestinationConnectionType : EzConnectionManager { Debug.Assert(null != source, @"The source component could not be nullable."); Debug.Assert(null != srcconn, @"The source connection could not be nullable."); Debug.Assert(null != destination, @"The destination component could not be nullable."); Debug.Assert(null != destconn, @"The destination connection could not be nullable."); //construct a srouce destionation package EzSrcDestPackage <SourceType, SourceConnectionType, DestinationType, DestinationConnectionType> package = new EzSrcDestPackage <SourceType, SourceConnectionType, DestinationType, DestinationConnectionType>(); package.Source = source; package.SrcConn = srcconn; package.Dest = destination; package.DestConn = destconn; //Add this package in project return(AddPackage(package)); }