Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to redimension arrays
Message
De
13/11/2003 15:37:54
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
 
 
À
13/11/2003 11:18:33
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00849545
Message ID:
00849658
Vues:
19
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform