Saving a List<Listing> to Xml

inkedGFX

Well-known member
Joined
Feb 2, 2013
Messages
142
Programming Experience
Beginner
I have a program I am currently working on, I would like to know if it is possible to create a List<Listing> listing being the class that holds the data, there are 62 fields that get pulled from a website . my question is .

what is the most efficent way to save this data to an xml file...right now I have it saving the data after each page is crawled...so the program crawls a page and gets the data(62) fields. then save it to an xml file..then crawls the next page...ect, ect....
there will be over 25,000 Listings in the xml file when complete...is it possible to create a List<Listing> and add the fields to the list and not save it until all the pages are crawled?

thank you

-InkedGFX
 
It certainly is possible. Another option might be to have a background thread doing the writing as data is added to a queue. The ConcurrentQueue<T> class would be perfect for use in such a scenario.
 
Back
Top Bottom