Ejemplo n.º 1
0
        protected override void OnExecute()
        {
            if (source == null)
            {
                throw new InvalidOperationException();  // *** TODO
            }

            if (destination == null)
            {
                throw new InvalidOperationException();  // *** TODO
            }

            // Create command that reads the table
            using (var cmd = source.CreateCommand())
            {
                using (var cn = source.OpenConnection())
                {
                    using (var tn = cn.BeginTransaction(IsolationLevel.ReadUncommitted))
                    {
                        cmd.Connection     = cn;
                        cmd.Transaction    = tn;
                        cmd.CommandTimeout = Timeout;

                        ImportTable(cmd, destination);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected void WriteTable(SourceTableQuery source, DataFileBase destination)
        {
            // Create command that reads the table
            using (var cmd = source.CreateCommand())
            {
                using (var cn = source.OpenConnection())
                {
                    using (var tn = cn.BeginTransaction(IsolationLevel.ReadUncommitted))
                    {
                        cmd.Connection     = cn;
                        cmd.Transaction    = tn;
                        cmd.CommandTimeout = Timeout;

                        WriteTable(cmd, destination);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        protected void WriteTable(SourceTableQuery source, DataFileBase destination)
        {
            // Create command that reads the table
            using (var cmd = source.CreateCommand())
            {
                using (var cn = source.OpenConnection())
                {
                    using (var tn = cn.BeginTransaction(IsolationLevel.ReadUncommitted))
                    {
                        cmd.Connection = cn;
                        cmd.Transaction = tn;
                        cmd.CommandTimeout = Timeout;

                        WriteTable(cmd, destination);
                    }
                }
            }
        }