[ConnectionConsumer("Input Values")] public void GetValues(ITransformableFilterValues values) { foreach (string val in values.ParameterValues) { //this.Provider_Values += this.Provider_Values != " " ?","+ "'" + val +"'" : "'" + val + "'" ; this.Provider_Values = val; this.Provider_Name = values.ParameterName; ds = new SqlDataSource(); ds.ID = "Source ID"; ds.ConnectionString = cString; ds.SelectCommand = this.SQLSelectCommand;//"select distinct " + cName + " from " + tName + " where " + this.Provider_Name+ " = '" + this.Provider_Values+ "';"; cBList.DataTextField = cName; cBList.DataValueField = cName; cBList.DataSource = ds; cBList.ID = "List ID"; cBList.Attributes.Add("onclick", "FindSelectedItems(this," + tB.ClientID + ");"); cBList.DataBind(); } } public void BuildControls() { try { cBList = new CheckBoxList(); this.Controls.Add(cBList); } //Sql exception cought. catch (Exception ex) { ex1 = ex.Message; } } protected override void CreateChildControls() { this.BuildControls(); base.CreateChildControls(); } protected override void OnInit(EventArgs e) { this.Page.LoadComplete += new EventHandler(Page_LoadComplete); base.OnInit(e); } void Page_LoadComplete(object sender, EventArgs e) { if (this.Page.IsPostBack && !String.IsNullOrEmpty(this.Provider_Name) && String.IsNullOrEmpty(this.Provider_Values)) { ds.SelectCommand = "select distinct " + cName + " from " + tName + " where " + this.Provider_Name + " = '" + this.Provider_Values + "';"; } }