Oracle/linq like command

Oracle/linq like command

Postby Trixz » Fri 02 Oct 2009 11:37

Ok, when i run a linq query i can get a like with this syntax

Code: Select all
var x = (from t in context.table
where t.column.startsWith("MyString")
select t);

sql
select t.* from table t where t.column like 'MyString%'



I can also use endWith or contains.
But what if I want to have a sql command that results in

Code: Select all
select t.* from table t where t.column like 'My%String'


is it possible?
Trixz
 
Posts: 31
Joined: Thu 30 Apr 2009 07:59

Postby Trixz » Fri 02 Oct 2009 11:46

Found it ... did not search ok

Answer: use SqlMethods.Like

Code: Select all
from t in context table
where SqlMethods.Like(t.column, 'My%str_ng'
Trixz
 
Posts: 31
Joined: Thu 30 Apr 2009 07:59


Return to dotConnect for Oracle