首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

linq中的模糊查询如何写的

2012-04-03 
linq中的模糊查询怎么写的?public static IQueryableproduct GetProductByKeyword(string keyword){EduD

linq中的模糊查询怎么写的?
public static IQueryable<product> GetProductByKeyword(string keyword)
  {
  EduDataContext db = new EduDataContext();
  return db.product.Where(p => p.name.Contains(keyword)).Where(p => p.state == 1).OrderByDescending(p => p.sortId);
  }

这么写好像不对啊。查不出来

[解决办法]
没看出你的写法有什么问题,是不是keyword本身就没有数据

热点排行