I wonder if anyone can help, although this is not specifically an ASP.NET question, but I am programming ASP.NET (c#) and had so many great answers on this forum.
I have an ArrayList which has elements of type Address
eg.
ArrayList address;
address.Add(new Address("Boston","N453"));
address.Add(new Address("London", "NW8 E89"));
public class Address
{
private string city;
private string postcode;
public address(string ct, string pc)
{
city = ct;
postcode =pc;
}
public string City
{
get { return city; }
}
public string Postcode
{
get { return postcode}
}
}
At another point in the application I need to pass an ArrayList as a parameter
someMethod(string a, ArrayList b)
{
???
}
I want to pass my address ArrayList to this method and get the values (in string format)
How would I do this?
Marika
I have an ArrayList which has elements of type Address
eg.
ArrayList address;
address.Add(new Address("Boston","N453"));
address.Add(new Address("London", "NW8 E89"));
public class Address
{
private string city;
private string postcode;
public address(string ct, string pc)
{
city = ct;
postcode =pc;
}
public string City
{
get { return city; }
}
public string Postcode
{
get { return postcode}
}
}
At another point in the application I need to pass an ArrayList as a parameter
someMethod(string a, ArrayList b)
{
???
}
I want to pass my address ArrayList to this method and get the values (in string format)
How would I do this?
Marika