0

私のプロジェクトでは、 20,000レコード以上を含む大きな xml ファイルを読みたいと思っています。このxmlファイルを読むのに最適なものは何ですか。

  1. xml をデータセットに読み込み、データセットをループしてデータベースを更新する
  2. xml オブジェクト (シリアル化) を作成し、各オブジェクトをループしてデータベースを更新しますか?

これについて私を案内していただければ幸いです。また、これを行う第 3 の方法があれば教えていただければ幸いです。

4

1 に答える 1

4

Try it. Number one rule of performance, always measure :-) Consider that both your options involves reading the entire XML into memory, which will take time and consume memory. A third option would be to use an XmlReader to read a single record at a time. I can only guess, but my bet is that XmlReader will be the fastest way.

于 2012-09-15T17:23:50.630 に答える