开发者

How to Use Like in Linq Dynamics?

I want to ach开发者_高级运维ieve something like this :-

var DB = new DALDataContext(); DB.Domains.Where("Name Like @p0",new [] {"field"});


use String.Contains() property for this condition. something like this source.Where(x => x.Name.Contains("someName"));

Also you can use SqlMethods.Like() from System.Data.Linq.SqlClient namespace

example:

       `var query = from s in Source 
        where SqlMethods.Like(s.Name, "%someName%")
        select s;`
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜