I defined a mapping table for constructing the search expression parts
Within a For each row over dtCriteria following LINQ generated the Search String respecting the dynamics
(From m In dtMap.AsEnumerable
Let val = row(m(0).toString).ToString
Where Not String.IsNullOrWhiteSpace(val)
Select para = m(1).toString.Trim.Replace("<par>", val )).toArray
- iteration over dtMap
- memorize the value of dtCriteria iteration row from Column with ColName as by current m(0) // Mapping table
- let it pass when value is present
- us the stringtemplate from mapping and replace place holder with the value from dtCriteria
after some minor things the seach strings were used in dtInput.Select method the filtering and did the the filtering
Find starter help here
Seetharaman_K.xaml (16.8 KB)
Kindly note: this was a fast prototype and you have to complete it e.g for this date.
Let us know in case of you need further help