Saving a List<Listing> to Xml


Well-known member
Feb 2, 2013
Programming Experience
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 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 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

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.
Top Bottom