开发者

Loading large data

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜