Using like with integer?

You may consider casting it to nvarchar first.

Tuna Toksöz
Eternal sunshine of the open source mind.

http://devlicio.us/blogs/tuna_toksoz
http://tunatoksoz.com
http://twitter.com/tehlike




On Fri, Jun 19, 2009 at 7:11 PM, csetzkorn <[email protected]> wrote:

>
> Hi,
>
> I would like to implement an ICriteria query for non-string object
> attributes. Usually I am using:
>
> crit.Add(Expression.Like(searchField, "%" + searchString.ToLower() +
> "%"));
>
> where searchField is the name of the object's attribute.
> Unfortunately, this does not work if the attribute is, for example, an
> integer. Is there an easy way to achieve this?
> I could use:
>
> crit.Add( Expression.Sql( SqlString( ... ???
>
> but this seems a bit cumbersome. Looking forward to hearing from you.
>
> Thanks.
>
> Best wishes,
>
> Christian
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to