LIKE

Determines whether a specific character String matches a specified pattern.
match [NOT] LIKE pattern [ESCAPE escape]

Arguments

match: An Entity SQL expression that evaluates to a String.
pattern: A pattern to match to the specified String.
escape: An escape character.
NOT: Specifies that the result of LIKE be negated.

Return Value

true if the string matches the pattern; otherwise, false.

Example

string esql;
IQueryable q;

esql = @"select p from Products as p
            where p.ProductName like '%aaa%'";
q = db.CreateQuery(esql);
q.Execute();

esql = @"select p from Products as p
            where p.ProductName like 'aaa'";
q = db.CreateQuery(esql);
q.Execute();


esql = @"select p from Products as p
            where p.ProductName like '%aaa'";
q = db.CreateQuery(esql);
q.Execute();

esql = @"select p from Products as p
            where p.ProductName not like 'aaa%'";
q = db.CreateQuery(esql);
q.Execute();

Last edited Mar 25, 2013 at 8:44 AM by ansiboy, version 1

Comments

No comments yet.