Protected Sub dsOTS_PerformGetDbCount(ByVal sender As Object, ByVal e As SD.LLBLGen.Pro.ORMSupportClasses.PerformGetDbCountEventArgs) Handles dsOTS.PerformGetDbCount
e.DbCount = dsOTS.EntityCollection.GetDbCount(e.Filter)
End Sub
This is what I have for my PerformGetDbCount and it's working fine but I'm not sure it the most efficent way to get the count.
It basically generates these two sql calls
[shortend for simplicity]
SELECT * FROM vwOrderTracking WHERE ( ( [Intranet].[dbo].[vwOrderTracking].[StatusId] = 2))
SELECT COUNT(*) AS NumberOfRows FROM (SELECT * FROM [Intranet].[dbo].[vwOrderTracking] WHERE ( (StatusId = 2))) TmpResult
[/sfs]
What's the point of the first call?