我可以将一个以上的Datalist与一个呕吐结合起来 [英] Can I Combine More Than One Datalist With One Pagging
本文介绍了我可以将一个以上的Datalist与一个呕吐结合起来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在数据库中有一个表格,其中我有三个类别数据,即红色,绿色,黄色
i将这些类别数据绑定到不同的数据列表,但我想在此实现分页控制所有三个数据主义者
我可以这样做吗?
请给出建议
i have a table in database in which i have three categories data i.e red, green, yellow
i bind these categories data to different datalists on the basis of category but i want to implement paging on this that controls all of three datalists
can i do this???
please give suggestions
推荐答案
最简单的方法是定义两个变量:currentpageno
和recordscountonpage
然后以这种方式调用linq查询:
The simplest way is to define two variables:currentpageno
andrecordscountonpage
then to call linq query this way:
var qry = DataObjects.Where(d => d.category=="green").Skip(currentpageno * recordscountonpage).Take(recordscountonpage);
看看在这里:
有效的寻呼使用g LINQ(示例代码) [ ^ ]
使用LINQ页面大型结果集 [ ^ ]
返回或跳过序列中的元素 [ ^ ]
Have a look here:
Effective Paging Using LINQ (Sample Code)[^]
Page large result sets with LINQ[^]
Return Or Skip Elements in a Sequence[^]
这篇关于我可以将一个以上的Datalist与一个呕吐结合起来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文