私のプロジェクトでは、 20,000レコード以上を含む大きな xml ファイルを読みたいと思っています。このxmlファイルを読むのに最適なものは何ですか。
- xml をデータセットに読み込み、データセットをループしてデータベースを更新する
- xml オブジェクト (シリアル化) を作成し、各オブジェクトをループしてデータベースを更新しますか?
これについて私を案内していただければ幸いです。また、これを行う第 3 の方法があれば教えていただければ幸いです。
私のプロジェクトでは、 20,000レコード以上を含む大きな xml ファイルを読みたいと思っています。このxmlファイルを読むのに最適なものは何ですか。
これについて私を案内していただければ幸いです。また、これを行う第 3 の方法があれば教えていただければ幸いです。
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.