Hi,
I have built a C# program that processes a huge amount of data and keep the processing results in arraylist.
This is takes a long time , so if I need to keep these results to be used in the next time , How can I do that.
Is there any way
Thanks too much.
Aya.

Keeping the arraylist value to the next program run.
Mark Net
if you mean maintain the data in memory then you'll have to leave a program running with that memory shared so that when you run your program it will have somewhere to fetch that data.
If you mean save it to disk then you can serialize the arraylist (XMLSerializer) or you can save it to a database.
The fastest way to load your data is, of course, to leave the data in RAM but this can be a waste if you aren't going to use it for a long time.
Snadge
The following link provide an example that solves the problem:
http://www.c-sharpcorner.com/Code/2003/Nov/StockPaperTrader.asp
Desire
Przemysław Rokicki
take a look at this, you could specify the additional types to use. I would also use a generic list too if you are running .NET 2.0. Otherwise maybe use an array of another type, like string[] or int[] or whatever it maybe
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=801237&SiteID=1
so from that example, when you are trying to serialize/deserialize, see what happens if you add an additional type of "ArrayList". Does this work
Markus Sch.
Ok, Thanks.
But now I have a problem, the serialization method has succeed except when the serialized object contains an ArrayList. It throws the " InvalidOperationException ".
The ArrayList is vey important in my application and really I need to serialize it, so how can I do so
Note , the article "XmlSerializer.Serialize Method (Stream, Object) " contains the foolowing line:
"Note The XmlSerializer cannot serialize the following: arrays of ArrayList and arrays of List."!!
Please help me, what can I do
Thanks,
Aya.
BeerBecks
More information about serialization can be found here: