|
Posted by Plamen Ratchev on 02/02/07 03:24
>> Do you use an ORDER BY clause in your query? That could be the issue,
>> since
>> in that case the data needs to be sorted on the SQL Server side before
>> the
>> first row is returned.
>>
>
>
> I don't, but I do not see the relevance. The *exact* same query in
> the Query Window of Management Studio starts executing immediately,
> and the grid starts populating within a second, where as the
> DataReader takes about 8-10 seconds before the first row is returned.
>
I pointed this out only because in my experiments with DataReader I have
seen the effect of ORDER BY. As for the comparison with the Query Window I
do not know what method was used to retrieve the data there, so it might not
be possible to achieve the same result with DataReader.
>
>> Is there any reason to display all 250,000 rows in your DataGrid?
>
> Yes, it is a customer requirement. The idea is to start populating,
> and continue populating the grid in the background, and the user can
> see that more rows are being retrieved, and he can cancel the
> retrieval at any time.
>
> Look at the Query Window in the Management Studio, that is exactly the
> behavior I seek.
>
Here is another idea. If you are using ADO.NET 2.0 you can explore the new
asynchronous execution. Maybe you can break your big result set to smaller
sets (similar to paging) and return each set asynchronously.
http://msdn2.microsoft.com/en-us/library/ms379553(VS.80).aspx
HTH,
Plamen Ratchev
http://www.SQLStudio.com
Navigation:
[Reply to this message]
|