Frage

I am using a Silverlight DataGrid with a DomainDataSource and a DataPager and EF 4 When using MSSQL server profiler, I noticed 2 queries which we taking the bulk of the data retrieval time. One query gets the data for the given load size, and another which gets the total page count. The one getting the page count is very slow for large sets of data, much slower than getting the data itself!

So my question is this: Is it possible to suppress this query? I know the datapager needs to know how many pages there are but I think I can work around that if I have to

Thanks

War es hilfreich?

Lösung

setting 'IncludeTotalCount' on the query to false worked. I did this in the override method of Load in the database context but iguess it can be done on a specific query.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top