I\'m using LINQ 2 Entities. Following is the problem:
string str = \'%test%.doc%\' .Contains(str) // converts this into LIKE \'%~%test~%.doc~%%\'
Split the String
var str = "%test%.doc%"; var arr = str.Split(new[]{'%'} ,StringSplitOptions.RemoveEmptyEntries); var q = tblUsers.Select (u => u); foreach (var item in arr) { var localItem = item; q = q.Where (x => x.userName.Contains(localItem)); }