Hi all,
Is it possible to loop through an object and put each element into an
array?
I have the following code breaks on the foreach because of
GetEnumerator not being a public definition. Not sure how to correct
it or what that means!
Many thanks,
try
{
XmlSerializer deserializer = new XmlSerializer(typeof
(Main));
textReader = new StreamReader
(System.AppDomain.CurrentDomain.BaseDirectory + "test.xml", true);
mainObj = (Main)deserializer.Deserialize
(textReader);
foreach(object o in mainObj) {
myArraylist.Add(o);
}
}