






roducts"].LoadAsync(() =>{//加载完毕}, (new DataQuery()).GreaterThan("UnitPrice",10f)); //查找Products表中所有UnitPrice小于等于10的记录this.context.Tables["
roducts"].LoadAsync(() =>{//加载完毕}, (new DataQuery()).SmallerThanOrEqualsTo("UnitPrice", 10f)); //查找Products表中所有UnitPrice小于等于10的记录//返回的结果集按ProductID进行升序排序this.context.Tables["
roducts"].LoadAsync(() =>{//加载完毕}, (new DataQuery()).SmallerThanOrEqualsTo("UnitPrice", 10f).OrderBy("
roductID")); //查找Products表中所有UnitPrice小于等于10的记录//返回的结果集按ProductID进行降序排序this.context.Tables["
roducts"].LoadAsync(() =>{//加载完毕}, (new DataQuery()).SmallerThanOrEqualsTo("UnitPrice", 10f).OrderByDescending("
roductID")); //查找Products表中所有UnitPrice大于10的记录//跨过前10条记录再取前5条记录//该查询方法可以用于分页操作this.context.Tables["
roducts"].LoadAsync(() =>{//加载完毕}, (new DataQuery()).GreaterThan("UnitPrice", 10f).Skip(10).Take(5)); //获取Products表中所有Discontinued为***e 并且UnitPrice大于20的记录this.context.Tables["
roducts"].LoadAsync(() =>{//加载完毕},(new DataQuery()).EqualsTo("Discontinued", ***e).GreaterThan("UnitPrice", 20f)); //And操作示例//获取Products表中所有Discontinued为***e 并且UnitPrice大于20的记录//该And操作与前一个示例的查询过程等效this.context.Tables["
roducts"].LoadAsync(() =>{//加载完毕},DataQuery.And((new DataQuery()).EqualsTo ("Discontinued",***e),(new DataQuery()).GreaterThan("UnitPrice",20f))); //Or操作示例//获取Customers表中,CustomerID为ALFKI或者Warensoft的所有记录//该操作将返回两条记录this.context.Tables["Customers"].LoadAsync(() =>{//加载完毕},DataQuery.Or((new DataQuery()).EqualsTo("CustomerID", "ALFKI"),(new DataQuery()).EqualsTo("CustomerID", "Warensoft")));




| 欢迎光临 纳金网 (http://go.narkii.com/club/) | Powered by Discuz! X2.5 |