Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to redimension arrays
Message
From
13/11/2003 15:37:54
 
 
To
13/11/2003 11:18:33
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00849545
Message ID:
00849658
Views:
18
Hello Alvin,

I use the second approach that Cathi mentioned on her reply.

Here is an example on how to use the ArrayList class.
I load data into a dataset, then I loop through it and
load the ArrayList with information from the dataset.
public class TerritoryCodes
{
	private string _name;
	private string _territoryID;

	public string Name
	{
		get {return _name;}
		set {_name = value;}
	}

	public string TerritoryID
	{
		get {return _territoryID;}
		set {_territoryID = value;}
	}
	


	public static ArrayList GetTerritoryCodes()
	{

		DataSet ds = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Web.Global.CfgKeyConnStringVips], "PT_ListAllTerritoryCodes");
		ArrayList territoryCodeArray = new ArrayList();
		// Separate Data into a collection of Territory Codes
		foreach(DataRow r in ds.Tables[0].Rows)
		{
			TerritoryCodes territoryCode = new TerritoryCodes();
			territoryCode.TerritoryID = r["Terr"].ToString();
			territoryCode.Name = r["Terr"].ToString() + " | " + r["County"].ToString() ;
			territoryCodeArray.Add(territoryCode);
		}
	
		return territoryCodeArray;
	}

}
Sergio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform