|
Posted by shripathikamath on 02/02/07 00:44
On Jan 31, 9:45 pm, "Plamen Ratchev" <Pla...@SQLStudio.com> wrote:
> DataReader by definition returns data as the query executes, one row at a
> time. The only buffering occurs on the client where data is kept in the
> network buffer until requested by the Read method. Based on that you should
> be seeing faster response.
>
> 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.
> 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.
> I have
> implemented many similar client applications and the best way to handle huge
> load has been to use paging. Normally 25-100 records per page are easy for
> users to look through. With that page size returning data is instantaneous.
> Then provide direct links to the other pages and allow users to jump quickly
> to a page.
>
Yes, I know of that technique.
> Here is an article with a few useful hints on optimizing ADO.NET
> performance:http://msdn2.microsoft.com/en-us/library/ms998569.aspx
>
Thanks.
[Back to original message]
|