protected void ddlCategoryProd_SelectedIndexChanged(object sender, EventArgs e) { int categId = int.Parse(ddlCategoryProd.SelectedValue); tblProduct = adpProduct.GetDataByCategory(categId); ddlProductName.DataSource = tblProduct; ddlProductName.DataTextField = "ProductName"; ddlProductName.DataValueField = "ProductId"; ddlProductName.DataBind(); ddlProductName.Items.Insert(0, new ListItem("Select a Product", "-1")); }