日期:2014-05-20  浏览次数:20798 次

如何将下面的SQL语句改成LINQ语句
select * from dbo.View_1 where DepName like '%" + textbox + "%'or UserName like '%" + textbox + "%'"

------解决方案--------------------
var q = from c in db.View_1
where SqlMethods.Like(c.DepName, "%"+textbox+"%")||
SqlMethods.Like(c.UserName, "%"+textbox+"%")
select c;