コード例 #1
0
        /// <summary>
        /// Add an Ado.Net 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="transform">transform component</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 AddAdoNetPackage <TransformType>(string srcserver, string srcdb, string srcsql,
                                                       TransformType transform, string destserver, string destdb, string desttable)
            where TransformType : EzComponent
        {
            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(null != transform, @"The transform component 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
            EzTransformPackage <EzAdoNetSource, EzSqlAdoNetCM, TransformType, EzAdoNetDestination, EzSqlAdoNetCM> package =
                new EzTransformPackage <EzAdoNetSource, EzSqlAdoNetCM, TransformType, EzAdoNetDestination, EzSqlAdoNetCM>();

            package.SrcConn.SetConnectionString(srcserver, srcdb);
            package.Source.SqlCommand = srcsql;
            package.Transform         = transform;
            package.DestConn.SetConnectionString(destserver, destdb);
            package.Dest.Table = desttable;

            //add this package in project
            return(AddPackage(package));
        }
コード例 #2
0
        /// <summary>
        /// Add a flat file source and oledb destination package with tranform in project
        /// </summary>
        /// <typeparam name="TransformType">Transform Component Type</typeparam>
        /// <param name="srcfile">source flat file</param>
        /// <param name="transform">transform component</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, TransformType transform,
                                                                string destserver, string destdb, string desttable)
            where TransformType : EzComponent
        {
            Debug.Assert(!string.IsNullOrEmpty(srcfile), @"The source file could not be nullable.");
            Debug.Assert(null != transform, @"The transform component 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 pacakge
            EzTransformPackage <EzFlatFileSource, EzFlatFileCM, TransformType, EzOleDbDestination, EzSqlOleDbCM> package =
                new EzTransformPackage <EzFlatFileSource, EzFlatFileCM, TransformType, EzOleDbDestination, EzSqlOleDbCM>();

            package.SrcConn.ConnectionString = srcfile;
            package.Transform = transform;
            package.DestConn.SetConnectionString(destserver, destdb);
            package.Dest.Table = desttable;

            return(AddPackage(package));
        }
コード例 #3
0
        /// <summary>
        /// Add an tranform 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="transform">tranform component</param>
        /// <param name="destination">destination adapter</param>
        /// <param name="destconn">destination connection manager</param>
        /// <returns>package stream name</returns>
        public string AddPackage <SourceType, SourceConnectionType, TranformType, DestinationType, DestinationConnectionType>
            (SourceType source,
            SourceConnectionType srcconn,
            TranformType transform,
            DestinationType destination,
            DestinationConnectionType destconn)
            where SourceType : EzAdapter
            where SourceConnectionType : EzConnectionManager
            where TranformType : EzComponent
            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 != transform, @"The transform component 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 transform package
            EzTransformPackage <SourceType, SourceConnectionType, TranformType, DestinationType, DestinationConnectionType> package =
                new EzTransformPackage <SourceType, SourceConnectionType, TranformType, DestinationType, DestinationConnectionType>();

            package.Source    = source;
            package.SrcConn   = srcconn;
            package.Transform = transform;
            package.Dest      = destination;
            package.DestConn  = destconn;

            //Add this package in project
            return(AddPackage(package));
        }
コード例 #4
0
        /// <summary>
        /// Add an oledb source and flat file destination package with transform 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="transform">transform component</param>
        /// <param name="file">destination flat file</param>
        /// <returns>package stream name</returns>
        public string AddOleDbToFilePackage <TransformType>(string srcserver, string srcdb, string srcsql,
                                                            TransformType transform, string destfile)
            where TransformType : EzComponent
        {
            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(null != transform, @"The transform component could not be nullable.");
            Debug.Assert(!string.IsNullOrEmpty(destfile), @"The destination file could not be nullable.");

            //construct a transform pacakge
            EzTransformPackage <EzOleDbSource, EzSqlOleDbCM, TransformType, EzFlatFileDestination, EzFlatFileCM> package =
                new EzTransformPackage <EzOleDbSource, EzSqlOleDbCM, TransformType, EzFlatFileDestination, EzFlatFileCM>();

            package.SrcConn.SetConnectionString(srcserver, srcdb);
            package.Source.SqlCommand         = srcsql;
            package.Transform                 = transform;
            package.DestConn.ConnectionString = destfile;
            package.Dest.Overwrite            = true;
            package.Dest.DefineColumnsInCM();

            return(AddPackage(package));
        }