public string[] getallTourID()
{
ArrayList TourIDs = new ArrayList();
foreach (Tour o in TourCollections) //TourCollections is an arraylist of tour objects
{
TourIDs.Add(o.getID); //ID is a string from the tour object
}
return TourIDs.ToArray(typeof(string));
}
Hi, I needed help with this issue where I cannot convert the arraylist to string array. The error says that:
Cannot implicitly convert type System.Array to string[], an explicit conversion exist
The problem comes from the ToArray() function. May I know what is the issue?
Will really appreciate the help :)