Before 2.1 I was able to write code like this (using the AddWhere):
Query q = new Query(Search.Schema);
q.BuildSelectCommand();
if (!String.IsNullOrEmpty(barcode)) q.AddWhere("Barcode", Comparison.Like, "%" + barcode.Trim() + "%");
if (!String.IsNullOrEmpty(fromDate)) q.AddWhere("FromDate", Comparison.GreaterOrEquals, fromDate);
if (!String.IsNullOrEmpty(toDate)) q.AddWhere("ToDate", Comparison.LessOrEquals, fromDate);
if (!String.IsNullOrEmpty(department)) q.AddWhere("DeptNo", Comparison.Like, "%" + department.Trim() + "%");
if (!String.IsNullOrEmpty(series)) q.AddWhere("SeriesNo", Comparison.Like, "%" + series.Trim() + "%");
if (!String.IsNullOrEmpty(altcode)) q.AddWhere("AltCode", Comparison.Like, "%" + altcode.Trim() + "%");
This allowed me to create nice search forms and only search on variables that users entered into the form, I am trying to reproduce this functionality in a simple manner with 2.1 and can't figure it out. Does anyone have any suggestions?