首页 > 代码库 > Linq高级查询,分页查询及查询分页结合

Linq高级查询,分页查询及查询分页结合

1、以...开头    StartsWith

Repeater1.DataSource=con.Users.Where(r=>r.Nickname.StartsWith("李"));

Repeater1.DataBind();

2、以...结尾     EndsWith

Repeater1.DataSource=con.Users.Where(r=>r.Nickname.EndsWith("同"));

Repeater1.DataBind();

3、模糊差(包含)    Contains

Repeater1.DataSource=con.Users.Where(r=>r.Nickname.Contains("蘇"));

Repeater1.DataBind();

4、个数

 

Linq高级查询,分页查询及查询分页结合