using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Default2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { int i=0; if (!IsPostBack) { //Set the db file AccessDataSource2.DataFile = ConfigurationManager.AppSettings["DataFile"]; //"~/database/ecodb.mdb"; //Select command if (Request.QueryString["TypeID"] != null) { string txtLabel1,txtLabel2; AccessDataSource2.SelectCommand = "SELECT * FROM [casestudies] WHERE caseStudyTypeID=" + Request.QueryString["TypeID"].ToString(); string str = Request.QueryString["TypeID"].ToString(); if (str == "7") { do { Label lbl1 = DataList2.Controls[i].FindControl("Label1") as Label; Label lbl2 = DataList2.Controls[i].FindControl("Label2") as Label; Label lbl3 = DataList2.Controls[i].FindControl("Label3") as Label; lbl1.Text = " "; lbl2.Text = " "; lbl3.Text = ""; i = i + 1; } while (i < DataList2.Items.Count); } } else AccessDataSource2.SelectCommand = "SELECT * FROM [casestudies]"; } } }