次のコードがあります
using (OracleConnection srcConn = new OracleConnection())
using (OracleConnection destConn = new OracleConnection())
{
srcConn.ConnectionString = AppInfo.SrcConnStr;
srcConn.Open();
destConn.ConnectionString = AppInfo.DestConnStr;
destConn.Open();
using (OracleCommand destCmd = new OracleCommand("ALTER SESSION SET NLS_DATE_FORMAT = 'yyyy-mm-dd hh24:mi:ss'", destConn))
using (OracleCommand srcCmd = new OracleCommand("ALTER SESSION SET NLS_DATE_FORMAT = 'yyyy-mm-dd hh24:mi:ss'", srcConn))
{
// Non-query
srcCmd.ExecuteNonQuery();
destCmd.ExecuteNonQuery();
if (Timing) { ut.TimeIt(stopwatch, "Get Connection and Command"); }
srcCmd.CommandTimeout = 0;
destCmd.CommandTimeout = 0;
srcCmd.CommandText = "select * from table_name";
rd = srcCmd.ExecuteReader();
rd.FetchSize = rd.RowSize * AppInfo.BatchSize; }
OracleBulkCopy copy = new OracleBulkCopy(destConn);
copy.DestinationTableName = DestTable;
copy.BatchSize = AppInfo.BatchSize;
copy.NotifyAfter = AppInfo.BatchSize;
copy.OracleRowsCopied += new OracleRowsCopiedEventHandler(OnOracleRowsCopied);
copy.BulkCopyTimeout = AppInfo.CommandTimeOut;
copy.WriteToServer(rd);
}
}
copy.WriteToServer(rd); になったとき。次のエラーが発生します
System.ArgumentException was caught
Message='0' is not a valid value for 'Interval'. 'Interval' must be greater than 0.
Source=System
StackTrace:
at System.Timers.Timer.set_Interval(Double value)
at Oracle.DataAccess.Client.OracleBulkCopy.PerformBulkCopy()
at Oracle.DataAccess.Client.OracleBulkCopy.WriteDataSourceToServer()
at Oracle.DataAccess.Client.OracleBulkCopy.WriteToServer(IDataReader reader)
私の質問は、どうすれば修正できますか?
どんな助けでも大歓迎です。