//Dispose method public void Dispose() { if (GlassCollection != null) { GlassCollection.Clear(); } if (BfeedCollection != null) { BfeedCollection.Clear(); } if (AuditCollection != null) { AuditCollection.Clear(); } if (WineCollection != null) { WineCollection.Clear(); } if (BreastCancerCollection != null) { BreastCancerCollection.Clear(); } if (IrisCollection != null) { IrisCollection.Clear(); } if (TitanicCollection != null) { TitanicCollection.Clear(); } if (RecommendedGroceries != null) { RecommendedGroceries.Clear(); } if (ClusterInformation != null) { ClusterInformation.Clear(); } if (PMML != null) { PMML = null; } if (RCode != null) { RCode = null; } if (CSharpCode != null) { CSharpCode = null; } }
/// <summary> /// Populates the values for a dropdown. /// Find a control is a bit tricky for DataLists since you have /// to loop through each item (row in the table) and find the /// control there. /// </summary> private void PopulateGlassDropdown() { GlassCollection gc = new GlassCollection(); gc.FetchAll(); DropDownList dd = null; int i = 0; foreach (ArtWork aw in ArtInTheCart) { dd = (DropDownList)listCart.Items[i].FindControl("drpGlass"); foreach (Glass g in gc) { string drpText = g.Title + String.Format(" - {0:c}", g.Price); ListItem li = new ListItem(drpText, g.Price.ToString()); dd.Items.Add(li); } dd.SelectedIndex = 0; i++; } }