Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using following query to select the data using Nhibernate.
var query = _session.GetNamedQuery("QueryNameFromHbmFile")
                                    .SetInt32("Col1", userId)
                                    .SetString("Col2", cropCode)
                                    .SetString("Col3", geometry)
                                    .SetString("Col4", startDate.ToString("dd-MM-yyyy"));

var resuls=query.SetResultTransformerFor<ModelClass>().List<ModelClass>().


Here all the data is loading in one call. I want to use Lazy loading here so that i can iterate over the data row by row. As it is also taking lot of time to transform the data to particular model type if it has lot of rows.

Is there any way to iterate row by row before loading complete data.?


Please Help.
Thanks in Advance!

What I have tried:

I am using following query to select the data using Nhibernate.
var query = _session.GetNamedQuery("QueryNameFromHbmFile")
.SetInt32("Col1", userId)
.SetString("Col2", cropCode)
.SetString("Col3", geometry)
.SetString("Col4", startDate.ToString("dd-MM-yyyy"));
var resuls=query.SetResultTransformerFor<modelclass>().List<modelclass>().

Here all the data is loading in one call. I want to use Lazy loading here so that i can iterate over the data row by row. As it is also taking lot of time to transform the data to particular model type if it has lot of rows.

Is there any way to iterate row by row before loading complete data.?

Please Help.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900