To answer the question, arraylist can contain anything so you are adding strings (the string could be represented as a GUID, but that's irrelevant, the string could contain "Hello world") which are stored as object references. To get the original type back you need to cast the object in the arraylist to whatever type it was when added, so you would need to cast it to a string. Once back as a string you need to use Guid.Parse (or TryParse) to create a GUID from the data that is in the string. So your code should be like this;
foreach (var i in Alist)
{
taxinfotaxfiled.TaxFieldID = Guid.Parse((string)i);
}
An alternative would be to store GUIDs in the ArrayList so you don't need to bother parsing;
ArrayList Alist = new ArrayList();
{
Alist.Add(new Guid("FD713788-B5AE-49FF-8B2C-F311B9CB0CC4"));
Alist.Add(new Guid("FD713788-B5AE-49FF-8B2C-F311B9CB0CC4"));
}
foreach (var i in Alist)
{
taxinfotaxfiled.TaxFieldID = (Guid)i;
}
As the other solution suggests, though, it is far better to use typed List objects like List<Guid> as ArrayList is old from before generics came along and let us do this stuff strongly-typed.
The next issue is that you're looping through each item in the arraylist and overwriting the TaxFieldID property with each item, so the overall effect is that the TaxFieldID is going to be the last value in the list, so that probably isn't the behaviour you are expecting.