コード例 #1
0
        void DoWrite(IDataQueue queue)
        {
            TableStructure ts;

            if (m_create_table)
            {
                ts          = new TableStructure(queue.GetRowFormat);
                ts.FullName = new NameWithSchema(m_schema, m_tblname);
                m_conn.SystemConnection.SafeChangeDatabase(m_dbname);
                m_conn.RunScript(dmp =>
                {
                    dmp.CreateTable(ts);
                });
            }
            else
            {
                ts = new TableStructure(DoGetRowFormat());
            }

            IBulkInserter inserter = m_conn.Dialect.CreateBulkInserter();

            inserter.Connection       = m_conn;
            inserter.CopyOptions      = CopyOptions.Clone();
            inserter.DatabaseName     = m_dbname;
            inserter.DestinationTable = ts;
            inserter.ProgressInfo     = ProgressInfo;
            inserter.Run(queue);
        }
コード例 #2
0
 private void Run()
 {
     try
     {
         var adapter = new CdlDataQueueAdapter(_queue);
         _inserter.Run(adapter);
     }
     finally
     {
         _queue.CloseReading();
     }
 }