/ Published in: C#
Expand |
Embed | Plain Text
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; }
You need to login to post a comment.
