开发者

Loading large data

开发者 https://www.devze.com 2023-04-01 05:50 出处:网络
I hava a datatable with large amount of data (250K). I have used DevExpress component and nhibernate. In devexpress components is server mode, but it does not suit me because I am using nHibernate.

I hava a datatable with large amount of data (250K).

I have used DevExpress component and nhibernate.

In devexpress components is server mode, but it does not suit me because I am using nHibernate.

In the table is many column as well. And 5 relation tables which开发者_StackOverflow中文版 displays together with main table (250K records). What a best way to advise me to achieve the goal?

Thanks and sorry for my English.

EDIT:

How to implement loading data with small portions?


If I understood your question, you probably need pagination: loading and displaying data in chunks. NHibernate supports this with ICreteria and a combination of SetFirstResult/SetMaxResults:

IList<MyObject> GetPageOfMyObjects(int pageSize, int zeroBasedPageNumber) {

    return Session.CreateCriteria(typeof (MyObject))
                    .SetFirstResult(pageSize*(pageNumber))
                    .SetMaxResults(pageSize)
                    .List<MyObject>();

}


Try to use paging. Also check if the devExpress ctx supports virtual paging with object data source so they can handle automatically the paging.

0

精彩评论

暂无评论...
验证码 换一张
取 消