日期:2014-05-20 浏览次数:20721 次
//查询 public ActionResult key(string keytxt) { ViewData["keytxt"] = keytxt; var showstxt = dbconn.movie集.First(m => m.title == keytxt); ViewData.Model = showstxt; return View(); } //上面传值没有问题,就是不知道怎么dbconn.movie集里查记录,如以下 //sql:select * from Cemetery where province like '%北京%'
var query= db.Table.Where(m=>m.province.IndexOf("北京"));//>>sql '%北京%" var query=db.Table.Where(m=>m.province.StartsWith("北京"));//>>sql "北京%" var query=db.Table.Where(m=>m.province.EndWith("北京"));//>>sql "%北京"
------解决方案--------------------
bool b = (from a in _ary
select a).Contains("");