SidoLishStort
New Member
Hi All! I'm building a search page and I want to put a few dynamic drop down lists on my page. I can create the drop downs no problem, but I want each one to be optional - how can I add another dummy item so that if the user doesn't want to search using one of the drop downs, they can just leave it on the dummy item? Here is the code I use to populate the drop downs:<BR><BR>public void Populate_DropDown (DropDownList myDropDown, string myTextField)<BR> {<BR> ddSelectCommand.CommandText = "SELECT DISTINCT " + myTextField + " FROM Case_Archive";<BR> System.Data.OleDb.OleDbDataReader Reader;<BR> Reader = ddSelectCommand.ExecuteReader();<BR> myDropDown.DataSource = Reader;<BR> myDropDown.DataTextField = myTextField;<BR> myDropDown.Items.<BR> myDropDown.DataBind();<BR> Reader.Close();<BR> }<BR><BR> <BR>private void Page_Load(object sender, System.EventArgs e)<BR>{<BR> if (!IsPostBack)<BR> {<BR> ArchiveConnection.Open();<BR> Populate_DropDown (ddStatus, "Status");<BR> ArchiveConnection.Close();<BR> }<BR>}<BR><BR>Then I'll pass the value of the drop down to a query to pull the desired records - any ideas?