How is LLBLGEN datasource2 paging working?

Posts   
 
    
nevernet
User
Posts: 67
Joined: 01-Feb-2010
# Posted on: 27-Dec-2010 07:26:07   

Hello

there is one LLBLGEN datasource2 control and asp.net GridView on page.

EnablePaging = true in LLBLGEN datasource2

GridView: AllowPaging = true PageSize = 10

then i have used sql server profile to track sql: the sql as below


exec sp_executesql N'SELECT COUNT(*) AS NumberOfRows FROM (SELECT [csb].[dbo]....)) TmpResult',N'@CompanyId1 int,@IsDeleted2 bit',@CompanyId1=9,@IsDeleted2=0


exec sp_executesql N'SELECT [csb].[dbo]....',N'@CompanyId1 int,@IsDeleted2 bit',@CompanyId1=9,@IsDeleted2=0

the second sql will return all records, why paging doesn't work? and "get count" sql has low performance. do we have another way to get count?

please advise. any ideas will be appreciated.

envionment as below .net framework 3.5 dnn 5.5.x llblgen pro 2.6 (self-servicing mode) iis7 sql server 2005

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 27-Dec-2010 09:17:43   

Please provide the llblgen pro runtime library version (build number). check this forum guidelines thread to now how to get this number.

nevernet
User
Posts: 67
Joined: 01-Feb-2010
# Posted on: 27-Dec-2010 09:57:44   

June 6th,2008?

nevernet
User
Posts: 67
Joined: 01-Feb-2010
# Posted on: 27-Dec-2010 10:01:06   

SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll - 2.6.8.804?

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 27-Dec-2010 10:14:20   

That's a too old, would you please try the latest build.

nevernet
User
Posts: 67
Joined: 01-Feb-2010
# Posted on: 27-Dec-2010 10:21:59   

yes,i will,

but current project is old project, and now it has low performance. so, do you have any suggestions except upgrade llblgen pro?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 27-Dec-2010 12:13:32   

It doesn't necessarily mean all rows are returned: it might be paging takes place on the client (reading X rows from the datareader, then close it), because 'distinct' wasn't applyable. This happens if a field in your resultset is of type Image, NText or Text. Could you check that, please?

Also, if you switch off livepersistence and implement the event handlers instead (see documentation for an example), please check whether the pagenumber/size parameters are indeed set.

Frans Bouma | Lead developer LLBLGen Pro
Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 27-Dec-2010 15:40:55   

so, do you have any suggestions except upgrade llblgen pro?

It's not an upgrade in it's full sense. But rather an update. I was asking to use the latest build of the same version (v.2.6).

nevernet
User
Posts: 67
Joined: 01-Feb-2010
# Posted on: 27-Dec-2010 15:40:56   

Hello

currently AllowDuplicates="False" and there is one field "Details" type is NText.

but why this field will cause no paging in SQL?

livepersistence = true and there is no events.

as i think, if paging takes place on the client ,it has low performance than paging takes place in SQL.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 28-Dec-2010 10:02:04   

but why this field will cause no paging in SQL?

Ans:

Otis wrote:

because 'distinct' wasn't applyable. This happens if a field in your resultset is of type Image, NText or Text

nevernet
User
Posts: 67
Joined: 01-Feb-2010
# Posted on: 28-Dec-2010 10:07:49   

Hello

sorry for misunderstanding.

i have disabled "AllowDuplicates" , now, AllowDuplicates="False" but there is no "distinct " in SQL, why?

thank you again.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 28-Dec-2010 10:14:57   

Distinct can't be applied to a query if the select list has fields of blob types (like Text and Image types).

nevernet
User
Posts: 67
Joined: 01-Feb-2010
# Posted on: 28-Dec-2010 10:17:28   

Oh,clear

thank you very much