- private string RowFilter(string field, string keywords)
- {
- string output = String.Empty;
- String[] straKeywords = keywords.Split(' ');
- int arrayLength = straKeywords.Length - 1;
- int i = 0;
- foreach (string keyword in straKeywords)
- {
- output += String.Format("([{0}] LIKE '%{1}%')", field, keyword);
- if (i++ < arrayLength)
- output += " OR ";
- }
- return output;
- }
No comments:
Post a Comment