I am fairly new to LINQ and now face a problem that i can not solve
alone, i need help. I have tried many things but not found a solution
I have a webform with 2 dropdown lists and a text box. I am letting
the user build a where statement based on what they choose.
For example dropdownlist1: (dealername, dealernumber, location),
dropdownlist2(<,>,<=,>=,==), and textbox is a free text field.
The where will be built as "DealerNumber <= 1001"
Now my code, will it be possible to change the where part to
incorporate my controls? I am using "q = q.Where(c => c.DealerNumber
can this be changed to:
field = dropdownlist1; condition = dropdownlist2; filter = textbox;
q = q.where(field + " " + condition + " " + filter);
using (PartsClassesDataContext db = new
List<spSelectFromMasterPartsResult> lst =
var q = from c in lst
q = q.Where(c => c.DealerNumber == strDealerNumber);
Many thanks i appreciate all your help