0

私は物事を正しく行っているかどうかを確認したいだけです。これは、クラスをテストしたコードです。

        Stopwatch sw = new Stopwatch();
        sw.Start();
        using (IfxConnection conn = new IfxConnection("Server=infdb.du.laus.hr:9089;UserID=*;Password=*;Database=argosy4sdr;Persist Security Info=True;"))
        {
            conn.Open();

            DataTable data = new DataTable();
            data.Columns.Add("numb");

            data.Rows.Add(5);
            data.Rows.Add(8);
            data.Rows.Add(9);

            IfxBulkCopy bulk = new IfxBulkCopy(conn);
            bulk.DestinationTableName = "bulktest";
            bulk.WriteToServer(data);
        }
        sw.Stop();

        MessageBox.Show(sw.ElapsedMilliseconds.ToString());

すべてが期待どおりに機能しますが、平均実行時間は 780 ミリ秒またはほぼ 1 秒ですか? 対照的に、IfxCommand オブジェクトの 3 回の実行は 4 ミリ秒で実行されます。

なぜこのような違いがあるのですか?私は何か間違ったことをしていますか?

4

0 に答える 0